java - android: AutoCompleteTextView with custom adapter -


i wrote custom adapter class extending baseadapter implementing filterable use autocompletetextview. filtering , selecting working fine.

the problem is, if item list clicked, autocompletetextview seems automatically call adapters getitem(int position) method , sets text getitem(position).tostring(). dont want behaviour im using custom objects in base adapter , resulting strings "classname [id=xx, variable1=var1]" put textview.

i tried setting own onitemclicklistener , onitemselectedlistener far, seems override above set string instead of directly writing custom string. how can disable default string?

oh, , overriding objects tostring() method not option in case.

any ideas? regards danijoo

// try  autocompletetext.setonitemclicklistener(new adapterview.onitemclicklistener() {              @override             public void onitemclick(adapterview<?> adapterview, view arg1, int position, long arg3) {                 string str = (string) adapterview.getitematposition(position);                 autocompletetext.settext(str);             }         }); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -