1

I have a autocomplete code that picks and displays options from the sqlite db based on the first letter/character entered. I want, when the right option is selected from list of displayed options, the value to be passed to a query and the result passed to an edittext field. The autocomplete change listener has a method

afterTextChanged(Editable s)

but it only seemingly accepts one character (not whole string). Any advice on how I can go about this? or an online resource to do further reading?

user3682205
  • 241
  • 4
  • 16

1 Answers1

1

You need to use AutoCompleteTextView for this purpose.

I'll suggest you should take a look at follow links.

Link 1 - Android AutoCompleteTextView CursorAdapter using SQLite Database and ArrayAdapter

Link 2 - Android getting strings from sqlite database to autocompletetextview

Link 3 - Android AutocompleteTextView with Database Data as Suggestions

Community
  • 1
  • 1
Noman Rafique
  • 3,735
  • 26
  • 29