5

I would like to prevent user from removing the account from the Android accounts for my app. Android AbstractAccountAuthenticator provides a method getAccountRemovalAllowed which I can use to prevent from removing account. So far so good.

But when I try to remove the account from settings, the dialog is scary. Says you can only remove by doing a factory reset. I would like to customize it saying you should uninstall the app to remove the account. Is there any way to do that?

I tried providing KEY_INTENT with my own activity but no effect.

public Bundle getAccountRemovalAllowed(AccountAuthenticatorResponse response,
        Account account) throws NetworkErrorException {
    // Cannot remove the account.
    final Bundle result = new Bundle();
            Intent i = new Intent(mContext, MyDialog.class);
    result.putParcelable(AccountManager.KEY_INTENT, i);
    return result;
}
Gautham
  • 3,418
  • 3
  • 30
  • 41

0 Answers0