I have created a custom Authenticator. When my Authentication activity is finishing up, it returns a result bundle to the callback. However the bundle seems to change by the time it reaches the callback.
Inside my Authentication activity onFinish()
I call mAccountAuthenticatorResponse.onResult(mResultBundle);
where my mResultBundle
contains an authToken
and a custom id (which is a simple key/value String/String pair in extras). However when I get the bundle in the callback
private AccountManagerCallback<Bundle> mGetAuthTokenCallback
= new AccountManagerCallback<Bundle>() {
@Override
public void run(AccountManagerFuture<Bundle> future) {
Bundle bundle = null;
try {
bundle = future.getResult();
the result is missing my custom parameter. What I can't understand is not only why my custom key/value pair is missing, but also why it appears if I re-add it before calling onResult
. So essentially if I add this line to my Activity and modify the intent before converting it into the bundle, the parameter makes it across to the callback.
result.putExtra(PARAM_ID,result.getStringExtra(PARAM_ID));
Confusing... I have debugged the code and in both cases with and without re-adding the extra parameter, the bundle looks exactly the same before it gets send out to the callback.
Has anyone seen any similar behaviour before? Any idea why this might be happening?
0 comments:
Post a Comment