【问题标题】:Importing Accounts导入帐户
【发布时间】:2011-05-07 23:12:03
【问题描述】:

大家。 在我的应用程序中,我尝试创建一个新帐户,但在添加过程中出现 SecurityException:“调用者 uid 10028 与验证者的 uid 不同”。我的代码是:

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());
}

谁能帮帮我?

【问题讨论】:

    标签: android


    【解决方案1】:

    也许这个链接会有所帮助:

    http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different

    听起来好像常量指定的AccountType与account-authenticator元素的XML中定义的AccountType不匹配,如果不匹配就会抛出这个异常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-27
      • 1970-01-01
      • 2014-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-30
      相关资源
      最近更新 更多