Autocomplete textview just show the last value which I submitted into database in Android -


i using textfield submiting names database pressing button in main activity.in activity use autocomplete textview showing names.but problem shows last name submitted.here code showing names in autocomplete textview:

for (contact cn : contact) {  string[] s1=new string[]{(cn.getname())};          arrayadapter<string> adapter =  new arrayadapter<string>(this, android.r.layout.simple_list_item_multiple_choice,s1);            a1.setthreshold(1);           a1.setadapter(adapter); } 

try this..

arraylist<string> s1 = new arraylist<string>();     (contact cn : contact) {         s1.add(cn.getname());     }     arrayadapter<string> adapter =  new arrayadapter<string>(this, android.r.layout.simple_list_item_multiple_choice,s1);       a1.setthreshold(1);      a1.setadapter(adapter); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -