That looks like it's going to work great. Thanks, Guillaume!
On Jan 26, 3:55 am, Guillaume Perrot <guillaume.p...@gmail.com> wrote: > HOME calls onPause then onStop most of the time. > BACK do the same but also calls onDestroy after onStop (if you didn't > override the BACK button behavior and no dialog or menu is being > displayed). > The Acitivity.finish() function do the same as the BACK button. > > You can try the following (I didn't test it): > You can have a boolean flag that your set when you press your button. > Then in onPause, test your flag: > If the flag is true (meaning you pressed the button), do nothing more. > if the flag is false it means BACK, HOME or another activity is over > yours: ensure the activity will finish by calling finish(); so that > the HOME button will do the same as the BACK one. > The side effect of this is that your activity will finish if you > launch another one over it. > > On Jan 26, 2:46 am, g1bb <corymgibb...@gmail.com> wrote: > > > Hello, > > > I have an activity that I would like the user to be able to put to > > sleep once the end call button is pressed, but terminate once the back > > or home buttons are pressed. Since it seems that end call and home > > both call OnPause(), is there a good way to do this? > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---