Every instance of Activity has a life cycle. During this life cycle, an activity transitions between three states: running, paused, and stopped. For each transition, there is an Activity method that notifies the activity of the change in its state. Figure below shows the activity lifecycle, states, and methods.
Figure 1 Activity state diagram
Subclasses of Activity can take advantage of the methods named in Figure 3.1 to get work done at critical transitions in the activity’s lifecycle.
You are already acquainted with one of these methods – onCreate(Bundle). The OS calls this method after the activity instance is created but before it is put on screen.
No Reviews found for this course.