How do I get the Context from the
Intent ?
You don't.
Since it's passed in the Intent
constructor, I was expecting it to be
available on arrival in the
AccountActivity.
The Context
is only used to help create the Intent
routing information. Since an Intent
can (and frequently does) live outside of any Context
, an Intent
cannot hold onto a Context
.
I need the Service (i.e. Context) that
created the Intent, so as to be able
to create an AsyncTask taking it in
the constructor.
You cannot do this, sorry.
If I don't do that I get:
"java.lang.SecurityException: caller
uid 10027 is different than the
authenticator's uid", since the
AsyncTask is doing Accountmanager am =
Accountmanager.get(context).
This has nothing to do with AsyncTask
. This has to do with processes, not threads.