gpt4 book ai didi

android - 如何在没有 AccountManager 或权限的情况下在 EditText 上显示用户电子邮件

转载 作者:搜寻专家 更新时间:2023-11-01 08:20:16 25 4
gpt4 key购买 nike

当我点击电子邮件的 EditText 时,我看到了很多应用程序,它显示了我在我的设备上使用的电子邮件列表,如图像 auto fill email

而且我确定它不是 AccountManager,因为它没有征求我的许可,也没有征求 Google 智能锁另外,我已经尝试了 AutoFill 服务

<android.support.design.widget.TextInputLayout
android:id="@+id/editNameInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar">

<android.support.design.widget.TextInputEditText
android:id="@+id/editName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name"
android:imeOptions="actionNext"
android:inputType="text"
android:textAlignment="viewStart"/>

</android.support.design.widget.TextInputLayout>

并以编程方式但它不起作用

 editEmail.setAutofillHints(View.AUTOFILL_HINT_EMAIL_ADDRESS);
editEmail.setImportantForAutofill(IMPORTANT_FOR_AUTOFILL_YES);

最佳答案

Autofill framework提供填写之前输入的密码、信用卡号等的功能。

您可以设置autofillhints 以允许此框架填写详细信息。

关注Optimize your app for autofill了解更多详情

注意:

An autofill service must be configured on your device for your app to use the autofill framework. Although most phones and tablets running Android 8.0 (API level 26) and higher ship with an autofill service, we recommend that you use a test service when testing your app

关于android - 如何在没有 AccountManager 或权限的情况下在 EditText 上显示用户电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52167977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com