可选的Android自动填充验证代码

问题描述 投票:0回答:2
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接收带有验证代码的SMS以登录我的应用程序,出现一个小的对话框,上面显示“自动填充代码”,这是来自消息应用程序的工具提示,如果您单击它,软键盘就会消失,然后立即出现第二个对话框,并从SMS中出现DE提取的验证代码,因此,如果您单击Edittext,则会自动填充该代码。 我的问题是,有没有办法禁用或配置此功能?我遇到的问题是,有时与代码的第二个对话框没有显示,并且我的应用程序隐藏了软键盘,并且无法提示它。

Autofill dialog add

android:importantForAutofill="no"
android android-studio android-edittext autofill android-autofill-manager
2个回答
7
投票
<EditText>

中的属性。


在选定字段上禁用此设施的方法 - 是要使系统宽SMS代码检测器沉默所需字段的名称的更改。
,例如,只需更改名称


0
投票

to

<androidx.appcompat.widget.AppCompatEditText android:id="@+id/desiredValue"

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.