i have listview put list of restaurants. added filter custom adpter. when put text in edittext field see restaurant asked for. filter works. have problem!!
let's suppose listview made of 5 restaurants:
row| restaurant
1 | john
2 | rino
3 | paul
4 | gino
5 | micheal
let's searching "ino", filter show me:
row | restaurant
1 | rino
2 | gino
here problem! when click on "rino" row number "1" 1 filtered .. need have "2" "the real" row rino. , so, if click on "gino" "2" whereas need "4" "the real row" gino. (look @ the first table wrote)
i need this.. click on restaurant's name , want see details restaurant. using filter getting wrong restaurant row number... , different restaurant detail! can ?
what got normal behavior of onitemclicklistener.
you need override public object getitem(int positon) method of adapter. method should return object display datas in row position.
then use following acces desired datas :
public void onitemclick(adapterview<?> parent, view view, int position, long id) { object object = youradapter.getitemp(position); // whatever want object }
Comments
Post a Comment