Week 3 - TableLayout, GUI Config Changes, Bundles, Saving/Restoring GUI State Flashcards
A TableLayout contains as many columns as the TableRow with the largest number of cells. True or false?
True.
What is a TableLayout?
A TableLayout is a view layout that arranges its child views into rows and columns. It contains a number of TableRow objects, one for each row.
The children of a TableLayout can specify the layout_width attribute without restriction. True or false?
False.
The layout_width attribute is always MATCH_PARENT.
The layout_height attribute of TableLayout’s children can be set without restriction. True or false?
True.
How does one evenly stretch the columns of a TableLayout?
The columns of a TableLayout can be stretched evenly by specifying the stretchcolumns attribute.
Example: Columns one through four are stretched with the following code.
android:stretchcolumns=”0,1,2,3”
How can all the columns of a TableLayout be stretched evenly without having to specify individual columns?
android:stretchcolumns=”*”
What is the primary strategy that Android uses to cater for varying screen sizes and orientations?
By utilising layouts with relative positioning, Android app GUIs can expand, contract, and reflow user interface elements to fit the screen.
What is the purpose of a system maintained bundle?
System maintained bundles are used to pass information between activities.
When are bundles used?
Bundles are used to pass additional information to the receiving activity when broadcasting an intent or explicitly invoking an activity.
How is information added to a bundle?
Information is added to a bundle by calling the bundle’s get and put methods with a key.
How do activities save their state so that they can pick up where they left off in the future?
Activities can save information representing their state in the bundle passed to the various onXXXXX() methods. This bundle persists after the activity is paused, terminated, etc.
When the activity is created or resumed, this bundle will be available and its information can be extracted.
How does one tell that there is no saved state bundle? (The bundle that is passed to the onXXXXX() methods.)
The saved state bundle will be a null instead of a reference to a bundle object.