使用自动完成值从sqlite获取新值并填充edittext

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?

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