It should work as your describe:
If you start activity A and then launch activity B from there, B will
be at the top of the Activity stack and A will be 'pushed' further
down (to the bottom in this case).
When the topmost activity (B in this case) finishes, the next visible
activity will simply be the activity one level lower down in the stack
(A in this case).

If your activity B isn't disappearing, then I'd make sure finish() is
working correctly.
1) Generally A should not ask B to finish, B should finish when it has
decided it is done
2) Check if the onDestroy() method of activity B is begin called, if
it isn't then there's something up with the way you're trying to
finish activity B

On Jul 22, 7:22 pm, Chris Stewart <cstewart...@gmail.com> wrote:
> I'm trying to wrap my head around activities and how they begin and end in
> Android.  I've read what the Developer Guide has to say regarding activities
> and I'm still a little fuzzy on how I should appropriately handle their
> navigation in my application.
>
> As an example, say I have a main activity that starts a secondary activity.
>  Once the secondary activity has completed it's purpose, I want to close it
> and return to the main activity.  I recall having read that the activity
> stack was just that, a stack of activities that are pushed and popped.  So I
> assumed that calling finish on the secondary activity would return me to my
> existing main activity.  Calling finish on the secondary activity didn't
> actually do anything, visibly at least.
>
> Is there further reading that anyone can recommend to me?
>
> Chris Stewart
> cstewart...@gmail.comhttp://www.androidsdkforum.com

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

Reply via email to