How do I find the original position in the ArrayList that is suggested in the MultiAutoCompleteTextView?

I have applied auto-hint on an array via MultiAutoCompleteTextView. When I click on the suggested list, I get the position of the item according to the suggested list, but I want the position of the item to be stored in the array. One way to get a position is

 int position=arrayList.indexOf(item); 

      

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

+3


source to share


1 answer


Use a value model and store one unique string per string, for example



    ArrayList<Person> listPerson=new ArrayList<Person>;             
    listPerson.add(new Person("AbcName","uniqueKey1")); 
    listPerson.add(new Person("AbcName","uniqueKey2"));

      

+4


source







All Articles