Dialog Box for Account Deletion Using Account Manager

I would like to prevent a user from deleting an account from Android accounts for my application. Android AbstractAccountAuthenticator provides a getAccountRemovalAllowed method that I can use to prevent account deletion. So far so good.

But when I try to remove the account from the settings, the dialog is scary. Says you can delete it by doing factory reset. I would like to configure it, saying that you need to delete the application in order to delete the account. Is there any way to do this?

I tried to provide KEY_INTENT 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; } 
+4
source share

Source: https://habr.com/ru/post/1434483/


All Articles