如何使用java代码将completionThreshold设置为AutoCompleteTextView?

Pab*_*s84 2 android autocompletetextview android-layout layoutparams android-view

我有这个AutoCompleteTextView:

AutoCompleteTextView a = new AutoCompleteTextView(this);
Run Code Online (Sandbox Code Playgroud)

我需要将completionThreshold标志值设置为1,我想学习使用java代码.我搜索谷歌和stackoverflow,我没有找到方法.

我只需要这样做: android:completionThreshold="1"使用java代码.

如何才能做到这一点?

Moh*_*eem 7

使用setThreshold(int)方法

了解更多信息setThreshold