避免多次登录
AccountManagerService
AccountAuthenticator(账户认证器)
<service
android:name=".AccountAuthenticatorService"
android:exported="true" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator_config" />
</service>
public class AccountAuthenticator extends AbstractAccountAuthenticator {
}
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="@string/account_type"
android:icon="@drawable/account_icon"
android:label="@string/account_name"
android:smallIcon="@drawable/account_small_icon" />