I have a few doubts about the Android architecture when dealing with authentication.
Suppose I call AccountManager.getAuthToken for a particular account I need to authenticate. Let’s say that authentication fails due to bad password. The AbstractAccountAuthenticator contract requires the authenticator to return a Bundle with the Activity that handles username/password input via KEY_INTENT.
My question is: who is supposed to show the UI? Does Android automatically detect that KEY_INTENT is present and run the UI or does my code have to startActivity with the intent embodied in the AccountManager‘s response? The same applies to AccountManager.addAccount which bundles the result through a Future interface.
Where can I find some tutorials on these topics?
Thank you
The system doesn’t automatically show the activity when
KEY_INTENTis present.It’s up to you to start that activity.
Here’s some sample code:
I hope this is what you were looking for, but in case I did not understand your question correctly, please clarify.
Cheers!