android - how to take the listview item from addTextChangedListener and display it in the corresponding edittext box -


//listview adapter   adapter_q = new arrayadapter<string>(authors.this, r.layout.list_item_author,r.id.product_name, quotes);     lv.setadapter(adapter_q);         //textviewq=(multiautocompletetextview)findviewbyid(r.layout.list_item_author);         system.out.println("before printing");  // filtering text          inputsearch.addtextchangedlistener(new textwatcher() {              @override             public void ontextchanged(charsequence cs, int arg1, int arg2, int arg3) {                 // when user changed text                 authors.this.adapter_q.getfilter().filter(cs);                }              @override             public void beforetextchanged(charsequence arg0, int arg1, int arg2,                     int arg3) {                 // todo auto-generated method stub              }              @override             public void aftertextchanged(editable arg0) {                 // todo auto-generated method stub                 }           }); 

taking selected item list , seeting edittext box

lv.setonitemclicklistener(new onitemclicklistener()         {             public void onitemclick(adapterview<?> arg01, view arg11, int arg21, long arg31) {                 valc=   arg01.getitematposition(arg21).tostring();                 system.out.println(valc);                 inputsearch.settext(valc);          }         });  

this search edittext box,i getting values in , filtering correctly, problem when select value list view, listview still remains there,

how dismiss take value list view?

assuming quotes arraylist of string passed adapter, need following:

lv.setonitemclicklistener(new onitemclicklistener()         {             public void onitemclick(adapterview<?> arg01, view arg11, int arg21, long arg31) {                  system.out.println(quotes.get(arg21));                 inputsearch.settext(quotes.get(arg21));          }         });  

because data want display stored in array list instead.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -