There is usually no need to call finish().

If you have avoided doing anything "clever", when the user presses the
[back] button your top activity will finish and the one underneath
will resume.

Put some trace lines ( use Log.d(...) ) in the following methods in
both of your activites and see what is printed.

onCreate
onStart
onResume
onPause
onStop
onDestroy

Don't forget to call the base class as all the above are overriden
methods from Activity.


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