Saturday, August 13, 2011

[android-developers] Re: Activity Lifecycle question

Test thoroughly before you say "it works". I have to say this because
1) the solution you describe still has a bad feel to it and 2) you
TALK about "calling finish()", but you don't show it in this latest
post. Are you calling it from goBack()? As the last thing it does?

On Aug 13, 8:21 pm, "hectordu...@yahoo.com" <hectordu...@yahoo.com>
wrote:
> thank you guys,
> finally it works by overriding the back button, calling goBack() and
> also calling finish().
>
>     @Override
>             public void onBackPressed() {
>                goBack();
>                //return;
>             }//onBackPressed
>
> hector
>
> On Aug 13, 12:00 pm, TreKing <treking...@gmail.com> wrote:
>
> > On Sat, Aug 13, 2011 at 11:22 AM, hectordu...@yahoo.com <
>
> > hectordu...@yahoo.com> wrote:
> > > i am trying to also do it form onPause(), onStop() , onDestroy ..... :-
>
> > Well there's your problem.
>
> > I don't know what will actually happen with you doing this, but that seems
> > wrong. Those methods are already called when the user has backed out, so
> > calling goBack() (and thus finish()) in them seem like it should be blowing
> > your stack or ripping the time-space continuum.
>
> > Don't call goBack() in those functions. If you need to set some result
> > Intent data, do that, but don't call finish().
>
> > OR, override the back key (see the Android blog for info on this) to stop
> > the current automatic finish(), then call your goBack() method.
>
> > -------------------------------------------------------------------------------------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment