Mic*_*l K 13 authentication android accounts
我已经为我正在处理的应用程序实现了一个自定义帐户.这是我的authenticator.xml:
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="MyApp"
android:icon="@drawable/logo"
android:smallIcon="@drawable/logo"
android:label="MyApp"
android:accountPreferences="@xml/account_preferences" />
Run Code Online (Sandbox Code Playgroud)
我可以使用Android设置的"添加帐户"功能添加帐户,我的应用可以使用所有帐户的信息.但是,该帐户并未在我的Google,Twitter,Faceboock等帐户的列表中显示.
Mic*_*l K 35
我在相关问题中找到了一条跟踪,提问者试图不在 Android设置中显示自定义帐户.如果您未指定标签,则该帐户不会显示在列表中.
如果您没有指定本地化字符串,则会发生同样的事情.我修改了它,添加了一个条目strings.xml
并更改:
android:label="MyApp"
Run Code Online (Sandbox Code Playgroud)
至:
android:label="@string/app_name"
Run Code Online (Sandbox Code Playgroud)
现在该帐户显示在"帐户和同步"部分的设置中.
归档时间: |
|
查看次数: |
2317 次 |
最近记录: |