> I just tried it on an app I'm working on (Android 2.1), and onStop() was
> called at the point I pressed the HOME button.

I am using Android 1.6 as I need to support all the phones which are
working on that version also. And in this version or atleast for my
situation its not working so.

>
> Are you doing anything unusual in your manifest vis a via
> android:launchMode or similar settings?
Yes I was using launchMode=singleTask. I actually wanted
singleInstance but somehow Voice recognizer is giving a connection
problem when I use singleInstance.

So just to see if it is working in the way you suggested, I tried
removing all the launchMode etc in manifest and just left the activity
name and label. This time onStop method or the onRestart method are
never ever called.

But these are being called when I set finishTaskOnLaunch to true in
the manifest.

Thank you anyway for the help and the suggestions. I atleast got it to
work to the most extent if not stopping the updates and the activity
on clicking home button.
>
> > The other thing is that I expected my stack to be as it is and as soon
> > as I open my app after hitting on home button, the activity which I
> > was previously in will be opened. But it restarted the app itself.
>
> > This is what I observed in my app.
> > Say I have a main activity A and another Activity B.
> > I come to Activity B from Activity A.
> > Then I click on home button.
> > It closes the app but does not yet call onStop on B.
> > Now I open my app and it now calls onStop on Activity B.
> > It starts Activity A again.
> > Now only when I click on button for activity B, it calls onRestart
> > method on Activity B.
>
> I just tried it with this same scenario (Activity A -> Activity B ->
> HOME), and again, onStop() was called at the point I pressed HOME.
>
> > So am I doing something wrong or is it supposed to work in that way or
> > is it a bug?
>
> Well, there appears to be something afoot either with your app or with
> your environment. onStop(), at least as of Android 2.1, seems to behave
> as documented for fairly ordinary stuff. Mind you that my test code does
> not mess with android:launchMode or flags on activity starting or
> whatever, so if you are, that's something to experiment with.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org

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