Chapter 5 Flashcards

1
Q

manifest

A

xml file containing metadata that describes your application to the android OS. every activity in an application must be declared in the manifest so that the OS can access it.

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

.CheatActivity why (.)?

A

dot tells the OS that this activity’s class is in the package specified in the package attribute in the manifest element at the top of the file.

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

how to start another activity (1)?

A

call the Activity method:

public void startActivity(Intent intent)

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

how startActivity(Intent intent) works:

A
when startActivity(...) is called on by the activity, this call is sent to the OS.
it is sent to a part of the OS called the ActivityManager.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ActivityManager

A

part of the OS and receives startActivity(…) calls. Creates the Activity instance and calls its onCreate(…) method.

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

Intent

A

knows which Activity to start. Object that a component can use to communicate with the OS

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

component examples:

A

services, broadcast receivers, activities, and content providers.

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

public Intent(Context packageContext, Class cls)

A

Class object specifies the activity that the ActivityManager should start. the Context object tells the ActivityManager which package the Class object can be found in.

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

When an activity in your application wants to start an activity in another application, you create an _______.

A

implicit intent (more in chapter 21).

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

extra (intent)

A

Extras are arbitrary data that the calling activity can include with an intent. the OS forwards the intent to the recipient activity, which can then access the extra and retrieve the data.

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

extra is structured as a key-value pair(t/f)

A

True

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

public Intent putExtra(String name, boolean value)

A

comes in many flavors, but it always has two arguments. String key and second argument is the value, whose type will vary.

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

public boolean getBooleanExtra(String name, boolean defaultValue)

A

first argument: name of the extra. Second argument: default answer if the key is not found.

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