Android M 6.0:无法删除帐户:java.lang.SecurityException
在棉花糖上,我在添加google帐户类型时遇到了这个例外: “java.lang.SecurityException:uid 10121无法删除的帐户 类型:com.google at“ 我使用Android M 6.0:无法删除帐户:java.lang.SecurityException,android,android-6.0-marshmallow,accountmanager,securityexception,android-securityexception,Android,Android 6.0 Marshmallow,Accountmanager,Securityexception,Android Securityexception,在棉花糖上,我在添加google帐户类型时遇到了这个例外: “java.lang.SecurityException:uid 10121无法删除的帐户 类型:com.google at“ 我使用 mAccountManager.addAccount("com.google", null, null, null, activity.this, null, null); 有时我需要使用删除所有帐户 mAccountManager.removeAccount(account,this,null,nu
mAccountManager.addAccount("com.google", null, null, null, activity.this, null, null);
有时我需要使用删除所有帐户
mAccountManager.removeAccount(account,this,null,null)代码>
该应用程序具有管理员角色,所有权限都是:
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
如何删除由google authenticator管理的帐户。。。?
当然,在棒棒糖上一切都很好
谢谢 对于Marshmellow,您需要运行时权限检查我下面的回答我已获得运行时权限:Manifest.permission.GET\u ACCOUNTS
Manifest.permission.GET_ACCOUNTS,Manifest.permission.READ_PHONE_STATE,Manifest.permission.WRITE_EXTERNAL_STORAGE