How can I get unfiltered position in filtered ListView?
Posted
by Julius
on Stack Overflow
See other posts from Stack Overflow
or by Julius
Published on 2010-05-16T13:03:54Z
Indexed on
2010/05/16
13:10 UTC
Read the original article
Hit count: 299
I am using ListView with ArrayAdapter to filter items in list. I have implemented onListItemClick() method to get clicked item position and call second activity using that value.
For example I have countries in my list:
Australia
Belgium
Botswana
Belize
...
Belgium has position 1
here.
However, if i type "Be" to filter items, I get one item as a result:
Belgium
Now if I click on this item, I get position 0
in onListItemClick(). But this behavior does not fit my needs. How can I get this item's unfiltered position (eg. 1
instead of 0
)?
© Stack Overflow or respective owner