繁体   English   中英

使默认 android 自动填充服务不仅记住登录名和密码,还记住服务器地址

[英]Make default android autofill service remember not only login and password, but also a server address

我需要让用户能够输入服务器名称(登录位置)以及登录该服务器的登录名和密码。 我尝试添加自动填充提示,但 Android 自动填充服务仅记住登录名和密码,并将服务器字段留空。 我尝试对服务器的字段使用几种不同的自动填充提示,但没有任何运气。

我正在使用默认的 Google Android 自动填充服务。

这是我的对话:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <ImageView
        android:src="@mipmap/ic_launcher_foreground"
        android:layout_width="44dp"
        android:layout_height="44dp"
        android:layout_gravity="center"
        android:contentDescription="@string/please_next" />

    <EditText
        android:id="@+id/address"
        style="@android:style/Widget.DeviceDefault.EditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="4dp"
        android:layout_marginTop="4dp"
        android:layout_marginRight="4dp"
        android:layout_marginBottom="16dp"
        android:background="#8C8C8C"
        android:fontFamily="sans-serif"
        android:hint="@string/adress"
        android:inputType="text"
        android:autofillHints="name"
        android:textColor="@color/pure_black" />

    <EditText
        android:id="@+id/username"
        style="@android:style/Widget.DeviceDefault.EditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="4dp"
        android:layout_marginTop="16dp"
        android:layout_marginRight="4dp"
        android:layout_marginBottom="4dp"
        android:background="#8C8C8C"
        android:hint="@string/username"
        android:autofillHints="username"
        android:inputType="textEmailAddress" />

    <EditText
        android:id="@+id/password"
        style="@android:style/Widget.DeviceDefault.EditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="4dp"
        android:layout_marginTop="4dp"
        android:layout_marginRight="4dp"
        android:layout_marginBottom="16dp"
        android:background="#8C8C8C"
        android:fontFamily="sans-serif"
        android:hint="@string/password"
        android:autofillHints="password"
        android:inputType="textPassword" />

</LinearLayout>

有什么方法可以让 Android aitoFill 服务记住登录过程中的三个字段吗?

我已经阅读了谷歌文档,但没有找到任何有用的信息。

Android 开发不是我的规范(我是后端程序员),所以,可能有很多东西对我来说是未知的。

因此,经过大量调查,我得出结论,如果表单中没有密码字段,默认的 google autoFill 服务只能记住多个字段。

因此,自动填充三个字段的最简单方法是手动制作,如果用户选中了“保存我的凭据”复选框,则将输入字段值存储到应用程序数据库中,如果已保存,则在启动时读回。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM