Week 1 - Android, Activity Lifecycle, Intents, Widgets Flashcards

0
Q

Which three methods are called when an app that is running is to be destroyed?

A
1. onPause()
(The app is no longer visible.)
2. onStop()
(The Activity is being disposed of by the system.)
3. onDestroy()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Which three methods are called when an app is launched and begins running?

A
  1. onCreate()
  2. onStart()
  3. onResume()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the four states that an activity can be in as part of the Activity Lifecycle?

A

Running, Paused, Stopped, and Destroyed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why does are apps sometimes ‘killed’?

A

Because it has been terminated (and removed from memory) because the operating system is attempting to reclaim memory for use by other apps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between an an app that has been killed and an app that has been shut down (or destroyed)?

A

An app that has been killed has been removed from memory to reallocate that memory to other apps. A apps that has been shut down has finished running, and has called the the onPause(), onStop(), and onDestroy() methods prior to being destroyed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the order of priority of the four states in the Activity Lifecycle?

A
  1. Running
  2. Paused
  3. Stopped
  4. Destroyed

(From highest to lowest priority.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of an Implicit Intent?

A

An Intent is an announcement to the operating system of the intention to perform an action. Depending on the type of the action, the operating system will determine the proper course of action. Intents are frequently used to launch another Activity either in the same app or a different app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What parameters does an Intent take?

A
  1. The current context.
  2. The class to transition to.
  3. (Optional) User-supplied data, usually in the form of key-value pairs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly