Professional Documents
Culture Documents
Week02-Android Activity Lifecycle
Week02-Android Activity Lifecycle
Activity Lifecycle
Component Lifecycle
• Component lifecycle
– From the beginning when Android instantiates a
component to respond to intents through to the end
when the instance is destroyed
– In between, the component may sometimes be active
or inactive
– Activities may be visible to the user or invisible
– Three states Resumed (at the top of the activity stack for the
current task)
F
Activity
A r onCreate()
n a onStart()
d m Paused
Resumed
Stopped
Started
onResume() Created
(partially
r e (hidden)
(visible)
visible)
o w onPause()
i o onStop()
d r onRestart()
k
onDestroy()
onCreate()
onStart() onRestart()
Entire Lifetime
onResume()
Lifetime
Visible
onPause()
onStop()
Activity
onDestroy() shut down