ExamGecko
Home Home / Google / Associate Android Developer

Google Associate Android Developer Practice Test - Questions Answers, Page 12

Question list
Search
Search

Related questions











Content labels. What attribute to use to indicate that a View should act as a content label for another View?

A.
android:contentDescription
A.
android:contentDescription
Answers
B.
android:hint
B.
android:hint
Answers
C.
android:labelFor
C.
android:labelFor
Answers
Suggested answer: C

Explanation:

Reference: https://support.google.com/accessibility/android/answer/7158690?hl=en

In application theme style, flag windowActionBar (<item name="windowActionBar">) indicates:

A.
whether the given application component is available to other applications.
A.
whether the given application component is available to other applications.
Answers
B.
whether action modes should overlay window content when there is not reserved space for their UI (such as an Action Bar).
B.
whether action modes should overlay window content when there is not reserved space for their UI (such as an Action Bar).
Answers
C.
whether this window's Action Bar should overlay application content.
C.
whether this window's Action Bar should overlay application content.
Answers
D.
whether this window should have an Action Bar in place of the usual title bar.
D.
whether this window should have an Action Bar in place of the usual title bar.
Answers
Suggested answer: D

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html

In application theme style, flag windowNoTitle (<item name="windowNoTitle">) indicates:

A.
whether this window should have an Action Bar in place of the usual title bar.
A.
whether this window should have an Action Bar in place of the usual title bar.
Answers
B.
whether there should be no title on this window.
B.
whether there should be no title on this window.
Answers
C.
that this window should not be displayed at all.
C.
that this window should not be displayed at all.
Answers
D.
whether this is a floating window.
D.
whether this is a floating window.
Answers
E.
whether this Window is responsible for drawing the background for the system bars.
E.
whether this Window is responsible for drawing the background for the system bars.
Answers
Suggested answer: B

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html

In application theme style, flag windowDrawsSystemBarBackgrounds (<item name="android:windowDrawsSystemBarBackgrounds">) indicates:

A.
whether this window should have an Action Bar in place of the usual title bar.
A.
whether this window should have an Action Bar in place of the usual title bar.
Answers
B.
whether there should be no title on this window.
B.
whether there should be no title on this window.
Answers
C.
that this window should not be displayed at all.
C.
that this window should not be displayed at all.
Answers
D.
whether this is a floating window.
D.
whether this is a floating window.
Answers
E.
whether this Window is responsible for drawing the background for the system bars.
E.
whether this Window is responsible for drawing the background for the system bars.
Answers
Suggested answer: E

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html

In application theme style, value statusBarColor (<item name="android:statusBarColor">) means:

A.
Color of text (usually same as colorForeground).
A.
Color of text (usually same as colorForeground).
Answers
B.
Shows a thin line of the specified color between the navigation bar and the app content.For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation. Corresponds to Window.setNavigationBarDividerColor(int).
B.
Shows a thin line of the specified color between the navigation bar and the app content.For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation. Corresponds to Window.setNavigationBarDividerColor(int).
Answers
C.
The color for the status bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE andView.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. For this to take effect, the window must be drawing thesystem bar backgrounds with
C.
The color for the status bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE andView.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. For this to take effect, the window must be drawing thesystem bar backgrounds with
Answers
D.
attr.windowDrawsSystemBarBackgrounds and the status bar must not have been requested to be translucent with R.attr.windowTranslucentStatus.Corresponds to Window.setStatusBarColor(int).
D.
attr.windowDrawsSystemBarBackgrounds and the status bar must not have been requested to be translucent with R.attr.windowTranslucentStatus.Corresponds to Window.setStatusBarColor(int).
Answers
E.
The color for the navigation bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE andView.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. For this to take effect, the window must be drawingthe system bar backgrounds with
E.
The color for the navigation bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE andView.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. For this to take effect, the window must be drawingthe system bar backgrounds with
Answers
F.
attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation.Corresponds to Window.setNavigationBarColor(int).
F.
attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation.Corresponds to Window.setNavigationBarColor(int).
Answers
Suggested answer: C

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html

An overridden method onCreateOptionsMenu in an Activity returns boolean value. What does this value mean?

A.
You must return true for the menu to be displayed; if you return false it will not be shown.
A.
You must return true for the menu to be displayed; if you return false it will not be shown.
Answers
B.
You must return false for the menu to be displayed; if you return true it will not be shown.
B.
You must return false for the menu to be displayed; if you return true it will not be shown.
Answers
C.
You can return any value: the menu will be displayed anyway.
C.
You can return any value: the menu will be displayed anyway.
Answers
Suggested answer: A

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/menus

For example, suppose that in a XML file (res/menu/menu_main.xml as an example), where menu items are described, we have such item:

A.
.<itemandroid:id="@+id/action_settings" android:orderInCategory="100"android:title="@string/menu_action_settings" app:showAsAction="never" />
A.
.<itemandroid:id="@+id/action_settings" android:orderInCategory="100"android:title="@string/menu_action_settings" app:showAsAction="never" />
Answers
B.
.Attribute "app:showAsAction" shows when and how this item should appear as an action item in the app bar. What value "never" in this attribute means?
B.
.Attribute "app:showAsAction" shows when and how this item should appear as an action item in the app bar. What value "never" in this attribute means?
Answers
C.
Only place this item in the app bar if there is room for it. If there is not room for all the items marked by this value, the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in theoverflow menu.
C.
Only place this item in the app bar if there is room for it. If there is not room for all the items marked by this value, the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in theoverflow menu.
Answers
D.
Also include the title text (defined by android:title) with the action item. You can include this value along with one of the others as a flag set, by separating them with a pipe.
D.
Also include the title text (defined by android:title) with the action item. You can include this value along with one of the others as a flag set, by separating them with a pipe.
Answers
E.
Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.
E.
Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.
Answers
F.
Always place this item in the app bar. Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the app bar.
F.
Always place this item in the app bar. Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the app bar.
Answers
G.
The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.
G.
The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.
Answers
Suggested answer: C

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/menus

To handle an options menu item click in an activity, we usually should override method named:

A.
onKey
A.
onKey
Answers
B.
onClick
B.
onClick
Answers
C.
onOptionsItemSelected
C.
onOptionsItemSelected
Answers
Suggested answer: C

Explanation:

Reference:

https://developer.android.com/guide/topics/ui/menus

Working with Custom View. To define custom attributes, we can add <declare-styleable> resources to our project. It is customary to put these resources into a file:

A.
res/layout/attrs.xml
A.
res/layout/attrs.xml
Answers
B.
res/values/attrs.xml
B.
res/values/attrs.xml
Answers
C.
res/raw/attrs.xml
C.
res/raw/attrs.xml
Answers
D.
res/xml/attrs.xml
D.
res/xml/attrs.xml
Answers
Suggested answer: B

Explanation:

Reference: https://developer.android.com/guide/topics/ui/custom-components

Working with Custom View. Once you define the custom attributes, you can use them in layout XML files just like built-in attributes. The only difference is that your custom attributes belong to a different namespace. Instead of belonging to the http://schemas.android.com/apk/res/android namespace, they belong to:

A.
http://schemas.android.com/apk/res/[your package name]
A.
http://schemas.android.com/apk/res/[your package name]
Answers
B.
http://schemas.android.com/apk/[your package name]
B.
http://schemas.android.com/apk/[your package name]
Answers
C.
http://schemas.android.com/[your package name]
C.
http://schemas.android.com/[your package name]
Answers
Suggested answer: A

Explanation:

Reference: https://developer.android.com/guide/topics/ui/custom-components

Total 128 questions
Go to page: of 13