I have an AutoCompleteTextView
in my app which works. I have successfully created an onClickItemListener
. The question is how to grab the text the
To get the text of the displayed item selected by the user
public void onItemClick(AdapterView> arg0, View arg1, int arg2, long arg3) {
String selectedItemText = arg0.getItemAtPosition(arg2);
Log.i("myTag", "SELECTED TEXT WAS["+selectedItemText+"]);
}
Following best practices, please use some form of descriptive nomenclature for your variables, your code will make more sense:
public void onItemClick(AdapterView> adapterViewIn, View viewIn, int selectedItemIndexIn, long id)