Code example for AutoCompleteTextView

Methods: setAdaptersetOnItemClickListener

0
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        if (App.getUser().isSearchSuggestionsEnabled()) { 
            searchField.setAdapter(suggestionHelper.getAdapter());
            searchField.setOnItemClickListener(this);
        } else { 
            searchField.setAdapter(suggestionHelper.getEmptyAdapter());
        } 
    } 
 
    @Override 
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (v.getId() == R.id.query_input && actionId == EditorInfo.IME_NULL) {
            startSearch(); 
        } 
        return false; 
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE