自定义 Android 自动填充服务不会出现在自动填充应用程序中

问题描述 投票:0回答:1

我按照this指南构建了自动填充服务。我通过 Android Studio 在 Pixel API 27 模拟器上运行它。

这是我的清单文件:`

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <service android:name=".EmailAddressFiller"
        android:permission="android.permission.BIND_AUTO_FILL">
        <meta-data android:name="android.autofill"
            android:resource="@xml/email_address_filler"/>
        <intent-filter>
            <action android:name="android.service.autofill.AutofillService"/>
        </intent-filter>
    </service>
    <activity android:name=".MainActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

`

但是,当我进入“设置”>“系统”>“语言和输入法”>“自动填充服务”时, 我不认为我的定制服务是一个选项。

很想在这里听到关于这个问题的任何想法。

android android-studio autofill
1个回答
0
投票
  1. EmailAddressFiller 类必须继承自 AutofillService 类
  2. 从 Android 12 开始,必须设置 android:exported: android:exported="true" (true 以便将此服务导出到其他应用程序)
© www.soinside.com 2019 - 2024. All rights reserved.