Search code examples
androidandroid-layoutandroid-viewautocompletetextviewlayoutparams

How to set completionThreshold to AutoCompleteTextView with java code?


I have this AutoCompleteTextView:

AutoCompleteTextView a = new AutoCompleteTextView(this);

I need to set completionThreshold flag value to 1, and i want to learn doing it with java code. I searched on google and stackoverflow and i didn't found the way.

I just need to do this: android:completionThreshold="1" with java code.

How can this be done?


Solution

  • use setThreshold(int) method

    for more info setThreshold