1

Can EditText display suggestion with small images when type ?

for example : when i type "Un", then EditText will show United states of america with its flag, and united kingdom with its flag.

is this possible to do? or using spinner ?

Thansk for your help all.

Tarsem Singh
  • 14,139
  • 7
  • 51
  • 71
Agoeng Liu
  • 674
  • 3
  • 10
  • 30

3 Answers3

0

Yes it's possible you will have to customize AutoCompleteTextView for this. Please refer below link this is pretty much same what you want to do :-

http://wptrafficanalyzer.in/blog/customizing-autocompletetextview-to-display-images-and-text-in-the-suggestion-list-using-simpleadapter-in-android/

Sumit Dhaniya
  • 596
  • 6
  • 14
0

If you want to display the suggestions while writing text inside your EditText then use AutoCompleteTextView with a custom adapter as suggested by @Milanix.

If you want to show Images then use SpannableString and Display Images using ImageSpan.Example

Community
  • 1
  • 1
strike
  • 1,031
  • 8
  • 24
0

Use AutocompleteTextView to do so. It is very simple make one List (List) of possible strings you want to suggest . Make one ArrayAdapter give the list of strings to adapter and set this array adapter to AutocompleteTextView. That's it.

Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77