List of usage examples for android.widget MultiAutoCompleteTextView setOnItemSelectedListener
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener l)
Sets the listener that will be notified when the user selects an item in the drop down list.
From source file:TIG055st2014.mailmaster.Activities.ComposeActivity.java
/** * Function used to configure the various MultiAutoCompleteTextViews (the autocomplete suggestions list that shows up when * writing in the to/cc/bcc fields)./*from w w w .j a va 2s . com*/ */ private void setupAC(final MultiAutoCompleteTextView ma, ArrayAdapter<String> adapter) { ma.setAdapter(adapter); ma.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); //How many letters needed to start showing suggestions. ma.setThreshold(0); ma.setOnTouchListener(new View.OnTouchListener() { //Making sure suggestions are shown directly. @Override public boolean onTouch(View v, MotionEvent event) { ma.showDropDown(); return false; } }); ma.setOnItemSelectedListener(this); }