views:

42

answers:

1

Hi, I am trying to model an app based on http://code.google.com/p/jumpnote/

authBundle = am.getAuthToken(account, APPENGINE_SERVICE_NAME,
                        needAuthAction == NEED_AUTH_NOTIFICATION, null, null).getResult();


authToken = authBundle.getString(AccountManager.KEY_AUTHTOKEN);

authToken is returned null in this case.

What can be possible causes for this?

A: 

Does the account already exist on the device? From the Class Overview section of the AccountManager javadoc:

Important: If the application is using a previously remembered account selection, it must make sure the account is still in the list of accounts returned by getAccountsByType(String). Requesting an auth token for an account no longer on the device results in an undefined failure.

Marc Bernstein