Chapter 3 Flashcards

1
Q

Activity method notifies the activity of the change in its state during a transition (true/false)

A

true

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

why override onCreate(…)?

A

inflating widgets and putting them on screen(setContentView(int)). getting references to inflated widgets. setting listeners to widgets. connecting to external model data.

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

android.util.log

A

sends log messages to a shared system-level log.

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

public static in d(String tag, String msg)

A

d stands for debug and refers to the level of the log message.tag identifies the source of the message, and msg is the contents of the message.

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

why call the superclass implementations before you log your messages?

A

superclass calls are required and is critical in onCreate(…)

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

what is @Override used for?

A

asks the compiler to ensure that the class actually has the method that you are attempting to override.

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

rotating a device changes the device configuration (t/f)

A

true

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

device configuration

A

set of characteristics that describe the current state of an individual device.

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

characteristics that make up device configuration:

A

screen orientation, screen density, screen size, keyboard type, dock mode, language, and more

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

screen density is a fixed component of the device configuration and cannot change at runtime (t/f)

A

true

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

alternative resource

A

resource that better match a new configuration

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

configuration qualifier

A

configuration qualifier on res sub directories are how android identifies which resources best match the current device configuration.

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

FrameLayout

A

FrameLayout simplest viewgroup and does not arrange its children in any particular manner. child views arrange according to their android:layout_gravity attributs

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

protected void onSaveInstanceState(Bundle outState)

A

normally called by the system before onPause(), onStop(), and onDestroy(). default implementation asks all of the activities views to save their state as data in the Bundle object. data is saved to the bundle object and is then stuffed into your activity’s activity record by the OS.

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

Bundle

A

structure that maps string keys to values of certain limited types.

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

super.onCreate(Bundle)

A

in the superclass implementation, the saved state of the views is retrieved and used to recreate the activity’s view hierarchy.

17
Q

types that you can save to and restore from a Bundle are primitive types and objects that implement the Serializable interface (t/f)

A

true.when you are creating custom classes, be sure to implement Serializable if you want to save them in onsaveInstanceState(…)

18
Q

android will destroy a running activity to reclaim memory(t/f)

A

false. the activity mus be in the paused or stopped state to be destroyed.

19
Q

activity record

A

activity record object lives in the OS. the OS can reanimate the activity using the activity record when it needs to.

20
Q

how is activity record discarded?

A

when the user presses the Back button. discarded on reboot and may also be discarded if they are no used for a long time.