java - Selected Item of Autocomplete Textview Show as simple Textview? -
i using autocomplete textview shows names database.i want show name in textview selected autocomplete textview.here code:
arraylist<string> s1 = new arraylist<string>(); (studentinfo cn : studentinfo) { s1.add(cn.getname()); } arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_dropdown_item_1line,s1); a1.setthreshold(1); a1.setadapter(adapter);
a1.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> arg0, view arg1, int arg2, long arg3) { } });
your s1
contains names database
a1.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> arg0, view arg1, int position, long arg3) { log.d("your selected item",""+s1.get(position)); //s1.get(position) name selected autocompletetextview // can show value on textview. } });
hope helps you,
Comments
Post a Comment