Custom AutoComplete in Android -


i want display list of contact names respective phone numbers

like


vikas patidar <9999999999>


rahul patidar <9999999999>


using autocompletetextview when user type text in mobile number field.

in default style can display list of names.

can please tell me how can implement when user select item in list , can display number of in mobile number field.

you need use adapter task. example, simpleadapter:

simpleadapter adapter = new simpleadapter(context, list, r.id.row_layout, new string[] { "name", "phone" }, new int[] { r.id.name, r.id.phone }); autocompletefield.setadapter(adapter); 

for need make layout xml file , list must of type list<? extends map<string, ?>. strings in 4th parameter keys maps in list. ints in 5th parameter identifiers of components in layout file.

or can extend adapter , use it. see link reference.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -