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?
问问题
495 次
1 回答
0
当屏幕关闭或用户离开您的活动时,就会调用 onPause()。当活动恢复时,会调用 onResume()。在此处阅读有关活动生命周期的更多信息:http: //developer.android.com/reference/android/app/Activity.html
于 2011-07-06T15:40:40.917 回答