私は Android を試していますAccountManager
。
ユーザー名/パスワードを入力するための UI を表示するアカウント認証サービスがあります。
[設定]、[アカウント]、[アカウントの追加] の順に移動し、新しいアカウントの種類を選択すると、UI が表示されます。
[OK] をクリックすると、次のエラーが表示されます
04-24 14:48:29.334: E/AndroidRuntime(386): java.lang.SecurityException:
caller uid 10035 is different than the authenticator's uid
MyAccountAuthenticationService の唯一の方法:
@Override
public IBinder onBind(Intent intent) {
return new MyAccountAuthenticator(this).getIBinder();
}
MyAccountAuthenticator:
@Override
public Bundle addAccount(AccountAuthenticatorResponse response,
String accountType, String authTokenType, String[] requiredFeatures,
Bundle options) throws NetworkErrorException {
final Intent intent = new Intent(context, MyAccountCreatorActivity.class);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
MyAccountCreatorActivity
の断片onClick
AccountManager accManager = AccountManager.get(this);
Account newAccount = new Account(email, MyAccountAuthenticator.ACCOUNT_TYPE);
accManager.setPassword(newAccount, password);
で例外がスローされsetPassword
ます。すでにすべてのアカウンティング権限が必要です。何が原因なのかわかりません。さらにコード/情報が必要な場合は、お問い合わせください。
ありがとうございました。