android - Delete File onLongListItemClick -
to open file listview have code:
@override protected void onlistitemclick(listview l, view v, int position, long id) { // todo auto-generated method stub super.onlistitemclick(l, v, position, id); option o = adapter.getitem(position); if(o.getdata().equalsignorecase("folder")||o.getdata().equalsignorecase("parent directory")){ currentdir = new file(o.getpath()); fill(currentdir); } else { onfileclick(o); }
and onfileclick(o) open file, when want delete file longclick can't, because nothing happens, can't in onlonglistitemclick method, tried this:
protected boolean onlonglistitemclick(view v, int pos, long id) { option o = adapter.getitem(position); if(o.getdata().equalsignorecase("folder")||o.getdata().equalsignorecase("parent directory")){ currentdir = new file(o.getpath()); fill(currentdir); } else { deletefile(o); } }
but doesn't work, knows happens? can me?
Comments
Post a Comment