Chapter 3 Flashcards
Activity method notifies the activity of the change in its state during a transition (true/false)
true
why override onCreate(…)?
inflating widgets and putting them on screen(setContentView(int)). getting references to inflated widgets. setting listeners to widgets. connecting to external model data.
android.util.log
sends log messages to a shared system-level log.
public static in d(String tag, String msg)
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.
why call the superclass implementations before you log your messages?
superclass calls are required and is critical in onCreate(…)
what is @Override used for?
asks the compiler to ensure that the class actually has the method that you are attempting to override.
rotating a device changes the device configuration (t/f)
true
device configuration
set of characteristics that describe the current state of an individual device.
characteristics that make up device configuration:
screen orientation, screen density, screen size, keyboard type, dock mode, language, and more
screen density is a fixed component of the device configuration and cannot change at runtime (t/f)
true
alternative resource
resource that better match a new configuration
configuration qualifier
configuration qualifier on res sub directories are how android identifies which resources best match the current device configuration.
FrameLayout
FrameLayout simplest viewgroup and does not arrange its children in any particular manner. child views arrange according to their android:layout_gravity attributs
protected void onSaveInstanceState(Bundle outState)
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.
Bundle
structure that maps string keys to values of certain limited types.