3

I applied auto suggest operation on arraylist through MultiAutoCompleteTextView. When I click on suggested list I get the position of item as per suggested list but I want position of item as per items saved in arraylist. One way to get the position is

 int position=arrayList.indexOf(item); 

But there may be possible duplicate items in the arraylist.How do I get the actual index from arraylist?

Tushar189
  • 346
  • 1
  • 11

1 Answers1

4

Use values model and save one unique string per row, for e.g.,

    ArrayList<Person> listPerson=new ArrayList<Person>;             
    listPerson.add(new Person("AbcName","uniqueKey1")); 
    listPerson.add(new Person("AbcName","uniqueKey2"));
Pranav Karnik
  • 3,318
  • 3
  • 35
  • 47
Tushar189
  • 346
  • 1
  • 11