Updating object in memory when Activity is stopped
<p>Just curious how people are handling this situation:</p>

<p>Let's say when your Activity is created you launch an AsyncTask or Thread to hit a web service and retrieve a piece of data.  Suppose, before the AsyncTask finishes, the user has hit some button that sends them to a new Activity.  While on the new Activity, the AsyncTask finishes.</p>

<p>When the AsyncTask finishes, you want a member variable of the first Activity to update, but that Activity is now stopped.</p>

<p>What do you do?  As I understand it, you can't safely access the member variable because Android could have reclaimed it.  You could use a BroadcastReceiver, but if you're no longer on that Activity, the BR won't receive the message.  So what is the right answer?</p>

<p>Update:</p>

<p>A possibility is to have the task write to a database and read from that database in the Activity's onResume().  However, in my case, this is not appropriate.  The data in my Activity is not to be written (read: saved) to the database until the user is finished with that Activity and has clicked a "save" button.</p>
