AccountAuthenticator.java:
Intent intent = new Intent(context, AccountActivity.class);
AccountActivity.java:
In onCreate(Bundle aBundle) I want to say:
getIntent().getContext();
But getContext() does not exist.
How do I get the Context from the Intent ?
Since it’s passed in the Intent constructor, I was expecting it to be available on arrival in the AccountActivity.
You don’t.
The
Contextis only used to help create theIntentrouting information. Since anIntentcan (and frequently does) live outside of anyContext, anIntentcannot hold onto aContext.You cannot do this, sorry.
This has nothing to do with
AsyncTask. This has to do with processes, not threads.