Sultan Saadat
Sultan Saadat

Reputation: 2278

Twitter-like Android Autocomplete Textview

I want to implement a twitter-like Android Autocomplete Listview but the existing Android Auto-complete Textview isn't good with adding images to the autocomplete suggestions. I need to download images and strings from the server and add to the suggestion box. I have added a reference image. Thanks.

enter image description here

Upvotes: 4

Views: 1831

Answers (1)

Dimitar Dimitrov
Dimitar Dimitrov

Reputation: 564

  • Create filterable listView as shown in this thread.
  • Extend the EditText to create control which on click opens for result new activity with editText control and the filterable listview bellow it.
  • Add onTextChangedListener on the edit text to filter the view.
  • Add onItemSelected Listener to the listView. When item is selected close the dialog and return the selected object
  • on Dialog cancel check if already entered value match value from the list if yes return the object if not return null.

Hope this helps.

Upvotes: 1

Related Questions