Gio
Gio

Reputation: 85

Disable Android autofill verification codes

I have an Android application that uses phone code verification to sign in, using one EditText to allow the user to enter the 4 digits code, I do not have an implementation of SMS Retriever API nor SMS User content API to automatically fill the EditText, but a couple of days ago I noticed that there is an option in the OS called Settings -> Google -> Verification code autofill (Testing on Android 10), so, if you enable that when you receive the SMS with the verification code to sign in into my App a small dialog appears that says "Auto fill code", it's kind of a tooltip from the messages app, if you click it the soft keyboard disappears and immediately after that a second dialog appears with de extracted verification code from the SMS, so if you click it the EditText it's automatically filled with the code.

My question is, ¿Is there a way to disable or configure this functionality? The problem that I have is that sometimes the second dialog with the code does not appear and my App remains with the soft keyboard hidden, and there is no way to prompt it back.

Autofill dialog

Upvotes: 3

Views: 6637

Answers (1)

Amit Kumar
Amit Kumar

Reputation: 71

Add android:importantForAutofill="no" as a property in your <EditText> in the xml file of layout.

Upvotes: 7

Related Questions