4

Number suggestions pop up when you tap at edittext. Is there a way to receive input as number but at the same time prevent number suggestions from displaying?

I have found something similar like this. but it accepts text not numbers!

Turn off autosuggest for EditText?

below are not working since it only accepts texts and then removes suggestions.

android:inputType="textFilter" 
android:inputType="textNoSuggestions" 

I have tried

android:inputType="number|textNoSuggestions" 

It results to accepting non-numeric symbols and does not remove suggestions either.

screenshot

  • 1
    try `android:digits="1234567890"` with `android:inputType="textFilter" android:inputType="textNoSuggestions"` – AskNilesh Sep 13 '18 at 07:40
  • does not work either. The suggestions still pop up. it also calls keyboard including a-z characters since the inputType is not a number. But thank you anyway – Leandro Keen Zapa Sep 13 '18 at 07:49

1 Answers1

20

Android O has the feature to support Auto-filling for fields,Just only use this in your xml, It will disable autofill hints

    android:importantForAutofill="no"
Sandeep Parish
  • 1,888
  • 2
  • 9
  • 20