Android programmatically disable autocomplete/autosuggest for EditText in emulator

后端 未结 12 536
鱼传尺愫
鱼传尺愫 2020-12-03 02:37

Targeting Android 2.2

I have read the answers to the following questions:

Turn off autosuggest for EditText?

Android: Multiline & No autosuggest

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-03 02:51

    You could simply use the EditText's setThreshold() method. Set the threshold to let's say 100 when you don't want to show predictions. If you want to re-activate showing predictions, set it back to a small int like 1 or 2 depending on your needs.

提交回复
热议问题