On Thu, Mar 11, 2010 at 10:51 PM, praj <[email protected]> wrote:

> I have an application where I navigate from Activity A to Activity B and
> back to A and then B.
>

Are you saying you open A then open B, press the back button to return to A
then do whatever it is you did the first time to get back to B? If so B will
be re-created with a brand new Intent which will contain whatever you
stuffed in there.


> I want to resume the activity B (which has a Bundle passed to it ) from
> Activity A.
>

What do you mean you want to "resume" B? If you've gone to B and pressed
back to get back to A, B is gone. It will recreated, not resumed.


> The documentation says that OnSaveInstance() is  called only when the
> activity is killed,
>

Not just that it's killed - when it's killed by the system and may
potentially need to be restored - like the user pressed the Home key. If you
press back or intentionally finish the activit, onSaveInstanceState is not
called.


> so how do i use OnPause which does not have the Bundle to resume the
> activity B.
>

You don't.

If you're trying to do what I think you're trying to do you might:
In A, start B with startActivityForResult().
In B, when pausing call setResult() with state information for B.
In A, onActivityResult() get the result Intent and save it for later.
When restarting B if you have the previous state information for B, pass
that in to the Intent for B.
In B onCreate get the Intent and get the state information from it, if it
exists.

Hope that helps. Good luck.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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