I am developing a simple app. I want to make sure that the simple calculation the app performs is stopped when the backlight times out. Does the OS handle this automatically? Does it "pause()" or "stop()" the foreground activity? Or do i need to set up a BroadcastReceiver to listen for an android.intent.action.SCREEN_OFF, and one for SCREEN_ON?
Asked
Active
Viewed 498 times
1 Answers
0
When the screen goes off, or the user navigates away from your activity, then onPause() is called. When the activity is resumed, onResume() is called. Read more on the activity lifecycle here: http://developer.android.com/reference/android/app/Activity.html

Todd Davies
- 5,484
- 8
- 47
- 71
-
Thanks, I'll take your word for it. – user820071 Jul 07 '11 at 12:53