Multiple choice

Match the callback methods in an activity class with their description.

(a) onCreate() 1. It is called when the first activity is created.
(b) onStart() 2. It is called when activity restarts after stopping it.
(c) onResume() 3. It is called before the activity is destroyed by the system.
(d) onPause() 4. It is called when the activity is no longer visible.
(e) onStop() 5. It is called when the activity becomes visible to the user.
(f) onDestroy() 6. It is called when the user starts interacting with the application.
(g) onRestart() 7. When It is called, the paused activity does not receive any further user input and cannot execute any code.

  1. a – 1; b – 5; c – 6; d – 7; e – 4; f – 3; g – 2

  2. a – 2; b – 5; c – 6; d – 7; e – 4; f – 3; g – 1

  3. a – 2; b – 4; c – 6; d – 7; e – 5; f – 3; g – 1

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

.