在安全模式下删除了Android帐户

时间:2016-03-01 00:03:36

标签: android accountmanager

我的应用程序使用AccountManager创建和帐户时出现问题,如果设备启动到安全模式,此帐户将被删除。在标准模式下再次启动设备时,帐户不会重新出现。

有没有办法让我的帐户在设备以安全模式启动时不会删除?

为了证明这不是我做错的基本事情,我从头开始重新创建了一个新的示例应用程序,它表现出相同的行为。

public static final String ACCOUNT_TYPE = "com.me.test";

Account account = new Account("test account", ACCOUNT_TYPE);
AccountManager.get(getApplicationContext())
    .addAccountExplicitly(account, null, null);

使用authenticator.xml

<?xml version="1.0" encoding="utf-8"?>
<account-authenticator
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="com.me.test"
    android:icon="@drawable/icon"
    android:smallIcon="@drawable/icon"
    android:label="@string/account_name"
    android:accountPreferences="@xml/account_preferences"
/>

由于

0 个答案:

没有答案