On Tue, Sep 6, 2011 at 9:57 PM, IcedNet <[email protected]> wrote:
> Activity two starts and calls an internal AsyncTask which uses
> `Activity.this.getIntent().getExtras().getString(<key>)` as a
> parameter for an object

Grab this value in the AsyncTask constructor or onPreExecute(). Do not
refer to an Activity in doInBackground(), as with configuration
changes, it might not be the right activity anymore.

> I decided to place those three lines of code in onCreate and use a
> String field instead of accessing the Activity's Intent within
> doInBackground and have yet to encounter the issue since doing so.

Sounds like a plan.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to