Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 961
Pableras84 Avatar asked Aug 02 '26 21:08

Pableras84


2 Answers

use setThreshold(int) method

for more info setThreshold

like image 192
Mohsin Naeem Avatar answered Aug 04 '26 10:08

Mohsin Naeem


You can also add following line in corresponding XML file:

android:completionThreshold="1"
like image 26
Mostafiz Rahman Avatar answered Aug 04 '26 10:08

Mostafiz Rahman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!