Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off autosuggest for EditText?

Is there a way to programmatically turn off that autosuggest list which pops up as you type in EditText?

like image 373
nikib3ro Avatar asked Dec 24 '09 20:12

nikib3ro


People also ask

How to disable auto suggestion in EditText android?

android:inputType="none|numberDecimal" The suggestions will appear for user, but user will not be able accept them.

How do I set autocomplete text on Android?

If you want to get suggestions , when you type in an editable text field , you can do this via AutoCompleteTextView. It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

What is autofill hints Android?

Some apps, such as password managers, can fill out the views in other apps with data previously provided by the user. These apps that fill out other apps are called autofill services. The autofill framework manages the communication between an app and an autofill service.


2 Answers

I had the same question but I still wanted to set this option in my XML file so I did a little more research until I found it out myself.

Add this line into your EditText.

android:inputType="textFilter"  

Here is a Tip. Use this line if you want to be able to use the "enter" key.

android:inputType="textFilter|textMultiLine" 
like image 52
glr Avatar answered Oct 01 '22 18:10

glr


android:inputType="textNoSuggestions"   

also you'd better read this

like image 25
kreker Avatar answered Oct 01 '22 20:10

kreker