Maybe register for the Intent.ACTION_SCREEN_OFF broadcast and call 
System.exit(0); when you get it?


On Monday, October 22, 2012 8:51:29 AM UTC-5, Saksham Chand wrote:
>
> Hi,
>
> I am writing an application where if the device goes to suspend mode, the 
> current activity should get destroyed, instead of being paused, and on 
> wake-up, its parent activity should be displayed.
>
> Currently, what I've done is to call onBackPressed() from onStop() 
> something like this:
>
> onStop()
> {
>     doCleanup();
>     if (!bBackPressed)   // Bool to teel if back button was pressed or not
>         super.onBackPressed();
>     super.onStop();
> }
>
> And in onSaveInstanceState() I'm doing nothing i.e. I'm not calling 
> super.onSaveInstanceState().
>
> I want to ask if I can call onBackPressed from onStop???
>
> Thanks,
> Saksham
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/android-discuss/-/F4CwaR4913QJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to