开发者

getting caller uid 10066 is different than the authenticator's uid [duplicate]

开发者 https://www.devze.com 2023-04-06 11:07 出处:网络
This question already has answers here: SecurityException: caller uid XXXX is different than the authenticator's uid
This question already has answers here: SecurityException: caller uid XXXX is different than the authenticator's uid 开发者_C百科 (17 answers) Closed 9 years ago.

I am using following code to add account into Account list

final AccountManager accountMgr = AccountManager.get(this.getApplicationContext());
 Account ac = new Account("my.id","com.google");
try{
      accountMgr.addAccountExplicitly(ac, "password", null);}
catch(Exception e){
 String str = e.getLocalizedMessage();
 Log.e("err",str);
}

but getting following error everytime: 'caller uid 10066 is different than the authenticator's uid'


The following stackoverflow question seems to deal with the issue:

SecurityException: caller uid XXXX is different than the authenticator's uid

The article it links to ( http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different ) explains the whole thing, though it took me a minute to realise what part of my code the last xml snippet was referring to.

I ended up storing my account type and auth token type in my strings.xml and referencing them in the authenticator.xml and code as needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号