Reputation: 271535
I have an android activity. If the user switches off the monitor of the android device for some time and then switches back on again, It seems like that the current activity is restarted. I found an activity lifecycle picture on the Internet but it does not tell me what method is called when the user switches off the monitor. It only tells me that when the activity is running, and "another activity comes in front of the activity", the onPause()
method is called. But a "black screen" is not "another activity", right?
So what is called when the device's monitor is switched off?
Upvotes: 2
Views: 2765
Reputation: 373
Activity lifecycle methods and state
onResume() called- Visible
onPause() called - Partially Visible
onStop() called - Invisible
If app is in memory, then onRestart call when app starts again, otherwise onCreate() called
Upvotes: 1