Code example for AutoCompleteTextView

Methods: getAdaptersetAdapter

0
 
    // This method will set the adapter if no adapter has been set.  The adapter is initialized 
    // here to prevent the drop-down from appearing uninvited on orientation change, as the 
    // AutoCompleteTextView.setText() will trigger the drop-down if the adapter has been set. 
    private void filterOnString(String string) {
        if (mAutoCompleteTextView.getAdapter() == null) {
            mAutoCompleteTextView.setAdapter(mFilterAdapter);
        } 
        mHideFilterSearchOnStart = false;
        mFilterAdapter.getFilter().filter(string);
    } 
}