How to set completionThreshold to AutoCompleteTextView with java code?

Pableras84 picture Pableras84 · Oct 16, 2012 · Viewed 7.8k times · Source

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?

Answer

Mohsin Naeem picture Mohsin Naeem · Oct 16, 2012

use setThreshold(int) method

for more info setThreshold