Android Application Components and Activity Lifecycle

Test your knowledge of Android application architecture, components (Activities, Services, Broadcast Receivers, Content Providers), and the activity lifecycle methods (onCreate, onStart, onResume, onPause, onStop, onDestroy).

20 Questions Published

Questions

Question 1 True/False

Activities are basic objects, describing things a user can see or do and they can subscribe for intents.

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

In a typical activity lifecycle, if an activity "AA1" is completely obscured by another activity "AA2", the current state of "AA1" activity is -

  1. Paused State
  2. Active State
  3. Stopped State
  4. Hidden State
  5. None of above
Question 3 Multiple Choice (Single Answer)

If an activity is paused or stopped, the system can drop it from memory by calling -

  1. Calling drop() method
  2. Calling finish() method
  3. Calling release() method
  4. kill the process_id
  5. Above b or d
  6. None of above
Question 4 True/False

The visible lifetime of an activity happens between a call to onStart() until a corresponding call to onPause(). Choose the right answer.

  1. True
  2. False
Question 5 True/False

The foreground lifetime of an activity happens between a call to onResume() until a corresponding call to onStop().

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

____ method is called just before the activity starts interacting with the user. At this point the activity is at the top of the activity stack, with user input going to it.

  1. onPause()
  2. onResume()
  3. onRestart()
  4. onStart()
  5. None of above
Question 7 Multiple Choice (Single Answer)

The activity in this state is killable by the system.

  1. onDestroy()
  2. onStop()
  3. onPause()
  4. Above a & c
  5. Above a & b
  6. Above a & b & c
Question 8 Multiple Choice (Single Answer)

The following method is called when the system is about to start resuming another activity

  1. onStop()
  2. onPause()
  3. onRestart()
  4. onDestroy()
  5. None of above
Question 9 True/False

The onStart() and onStop() methods can be called multiple times, as the activity alternates between being visible and hidden to the user.

  1. True
  2. False
Question 10 Multiple Choice (Single Answer)

__________ method is called when activity is first created

  1. onStart()
  2. onResume()
  3. onCreate()
  4. None of above
Question 11 Multiple Choice (Single Answer)

Between ______ & ________methods, you can maintain resources that are needed to show the activity to the user.

  1. onResume(), onStop()
  2. onStart(), onStop()
  3. onStart(), onDestroy()
  4. onResume(), onDestroy()
  5. None of above
Question 12 Multiple Choice (Single Answer)

________ method is passed a Bundle object containing the activity's previous state, if that state was captured.

  1. onCreate()
  2. onResume()
  3. onStart()
  4. None of above
Question 13 Multiple Choice (Single Answer)

Suppose there are two applications having same priority, but the process that has _______ priority will be killed first.

  1. Highest
  2. Lowest
  3. Medium
  4. None of above
Question 14 True/False

An Android Application can be “Alive” even when process has been killed

  1. True
  2. False
Question 15 True/False

All Android applications will remain running and in memory until the system needs its resources for other applications.

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

A typical Android application has ________ components.

  1. 3
  2. 5
  3. 4
  4. 6
  5. None of above
Question 17 Multiple Choice (Single Answer)

An android application includes the following components -

  1. Activity, Service, Process and Content Provider
  2. Activity, Intent, Process and Service
  3. Activity, Service, Broadcast Receiver and Content provider
  4. Service, Process, Broadcast Receiver and Content Provider
  5. None of above
Question 18 True/False

Android Application typically consist of several screens where each screen is implemented by more than one activity. Choose the right answer.

  1. True
  2. False
Question 19 True/False

A fundamental feature of Android is that an application process's lifetime is directly controlled by the application itself.

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

An activity has essentially ___ states.

  1. 3
  2. 4
  3. 2
  4. 5
  5. None of above