everybody. In my application I try to create a new Account, but I got a Se开发者_StackOverflow社区curityException during adding it: "caller uid 10028 is different than the authenticator's uid". My code is:
AccountManager accountManager = null;
accountManager = AccountManager.get(this);
Account sampleAccount = new Account(ACCOUNT_NAME, ACCOUNT_TYPE);
boolean isSuccess=false;
if (accountManager != null) {
try {
isSuccess = accountManager.addAccountExplicitly(sampleAccount,
ACCOUNT_PASSWORD, null);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
Can anyone help me?
Perhaps this link will help:
http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different
It sounds like the AccountType specified by the constant does not match up with the AccountType defined in the XML of the account-authenticator element, and if they do not match up, it throws this exception.
精彩评论