Deck 3: Coding the Gui Programmatically, Layout Managers
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/20
Play
Full screen (f)
Deck 3: Coding the Gui Programmatically, Layout Managers
1
A GUI cannot be defined programmatically; we must define it in an XML file.
False
2
____________ is a layout manager class that organizes GUI components in a grid.
GridLayout
3
It is possible to retrieve the width of the screen programmatically.
True
4
What is the only method of the View.OnClickListener interface?
A) click
B) onClickView
C) clicked
D) onClick
A) click
B) onClickView
C) clicked
D) onClick
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
5
Adding a Null GUI component to a View will result in a(n) ____________.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
6
Gravity is in the ____________ package.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
7
In order to implement game play inside the Activity class (the Controller), we ____________ methods of the Model.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
8
If B is a public, static, inner class of A, ____________ refers to B.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
9
One of the spec methods of GridLayout has the following API:
Public, static GridLayout.Spec spec( int s1, int s2 )
What do s1 and s2 represent?
A) Nothing, these parameters are useless.
B) s1 is the number of rows, and s2 is the number of columns.
C) s1 is the starting index, and s1 is the size.
D) s2 is the size, and s1 is the starting index.
Public, static GridLayout.Spec spec( int s1, int s2 )
What do s1 and s2 represent?
A) Nothing, these parameters are useless.
B) s1 is the number of rows, and s2 is the number of columns.
C) s1 is the starting index, and s1 is the size.
D) s2 is the size, and s1 is the starting index.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
10
The show method belongs to the AlertDialog.Builder class.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
11
What method do we use to set the number of rows in a GridLayout?
A) setRowsCount
B) setRowCount
C) setRow
D) setRows
A) setRowsCount
B) setRowCount
C) setRow
D) setRows
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
12
We used the GridLayout.Spec class in the chapter. What can we say about Spec?
A) It is a private, static, inner class of GridLayout.
B) It is a protected, static, inner class of GridLayout.
C) It is a public, static, inner class of GridLayout.
D) It is a public, static, independent class from GridLayout.
A) It is a private, static, inner class of GridLayout.
B) It is a protected, static, inner class of GridLayout.
C) It is a public, static, inner class of GridLayout.
D) It is a public, static, independent class from GridLayout.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
13
An AlertDialog.Buider constructor has this API:
Public AlertDialog.Buider ( Context context)
Inside an Activity class, when using the constructor, what argument do we pass?
A) We do not pass any argument.
B) void
C) this
D) main
Public AlertDialog.Buider ( Context context)
Inside an Activity class, when using the constructor, what argument do we pass?
A) We do not pass any argument.
B) void
C) this
D) main
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
14
When we call the getSize method of the Display class, its Point parameter gets written too.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
15
The Color class in the android.graphics package is the same as the Color class in the java.XYZ.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
16
A dialog box can have only one button inside.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
17
If we want to code the View programmatically and separate the View from the Controller, then we should have an instance variable representing the View inside the Controller so that we can call the methods of the View in order to update it.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
18
The getDefaultDisplay method from the WindowManager interface returns a __________________ reference.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
19
The View.OnClickListener interface can be implemented to handle a __________________ event on a View.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck
20
If TicTacToe is the class for the Model and we are inside the Activity class (the Controller), we can use an instance variable of type __________________ to represent the Model.
Unlock Deck
Unlock for access to all 20 flashcards in this deck.
Unlock Deck
k this deck