客户经理:Android App未显示在“设置”的“帐户”标签下,

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

我正在尝试将我的应用程序设置为“帐户部分”。因此,当用户点击添加帐户时,我的应用名称可见。完整的代码可以找到here我已经创建了一个身份验证服务。这就是我的清单的样子

<service android:name=".AuthenticatorService">
        <intent-filter>
            <action android:name="android.accounts.AccountAuthenticator" />
        </intent-filter>
        <meta-data android:name="android.accounts.AccountAuthenticator"
                   android:resource="@xml/authenticator" />
    </service>

我还创建了一个“authenticator.xml”

    <?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
                       android:accountType="com.udinic.auth_example"
                       android:icon="@drawable/ic_launcher"
                       android:smallIcon="@drawable/ic_launcher"
                       android:label="testing"
                       android:accountPreferences="@xml/prefs"/>

但我仍然没有在帐户下看到我的应用程序。我关注this tutorial,但它不起作用。你能告诉我我做错了什么吗?

android android-syncadapter accountmanager
1个回答
1
投票

使用资源字符串而不是在标签中使用文字文本。

“authenticator.xml”

android:label="@string/some_label"
© www.soinside.com 2019 - 2024. All rights reserved.