There is an AutoCompleteTextView in it in the code values ​​are entered.
How when clicking / focusing on a field display at once a list with all added values?

 AutoCompleteTextView textView = (AutoCompleteTextView)findViewById(R.id.editFriendCode); String[] values = new String[]{"0f020", "ca35c"}; ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, values); textView.setAdapter(adapter); View.OnClickListener fdcClick = new View.OnClickListener() { @Override public void onClick(View view) { view.showContextMenu(); // не работает так } }; textView.setOnClickListener(fdcClick); 

Otherwise, it displays only the values ​​if you enter 2 characters, and you want to display without entering data

I ask for help or hints of another solution.

UPD

setOnTouchListener also does not channel ...

    1 answer 1

    Create a custom AutoCompleteTextView

     public class InstantAutoComplete extends AutoCompleteTextView { public InstantAutoComplete(Context context) { super(context); } public InstantAutoComplete(Context arg0, AttributeSet arg1) { super(arg0, arg1); } public InstantAutoComplete(Context arg0, AttributeSet arg1, int arg2) { super(arg0, arg1, arg2); } @Override public boolean enoughToFilter() { return true; } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused && getAdapter() != null) { performFiltering(getText(), 0); } } } 

    And then in xml

     <package.InstantAutoComplete ... /> 
    • ohh thanks, works - tCode
    • @tCode, you can tick the correct answers :) - Flippy
    • it was impossible to click right away) - tCode
    • @tCode, good luck with coding! - Flippy
    • And still such question how to redefine a method which inserts the text selected from the list in the field? - tCode