Android Action Bar and Tab Navigation
Tests knowledge of Android Action Bar, Tab navigation modes, ShareActionProvider, ViewPager, and related UI components in the Android View Framework
Questions
The ___________ is automatically added to your app if it is using one of the Holo themes.
- Menu bar
- Title bar
- Toolbar
- Toolbar
Which of the following Android versions does not support action bar API?
- Android 4.0
- Android 3.0
- Android 4.2.2
- Android 2.0
It is recommended that the android:showAsAction attributes to ________, which will display the menu item as an action item only if there is enough room on the display.
- withText
- ifRoom
- ifNotRoom
- withRoom
What is the working of the following code?
android:showAsAction=”collapseActionView”
- This will collapse the action view into just an action item.
- This will completely collapse the action view.
- This will completely collapse the action item.
- The search widget would consume space on the action bar even when it is not in use.
The service from which we share images, text file, etc. through mail, facebook , bluetooth is
- ShareService
- ShareServiceProvider
- ShareActionProvider
- Sharing
When we have a large number of navigation options, then which of the following modes is suitable?
- Tab navigation mode
- Viewpager
- List navigation mode
- Tabwidget
Which of the following statements is/are correct?
A. ActionProvider is a new class available in Android 4.0.
B. The action bar is a way to quickly add functionality to your application, while maintaining a native platform look and feel.
- Only A
- Only B
- Both A and B
- Neither A nor B
Which of the following interfaces/classes is used to implement/define the methods onTabSelected, TabUnselected and onTabReselected?
- ActionBar
- ActionBarListener
- ActionProvider
- TabListener
Which of the following classes is used to add the tabs to a subview of your app?
- ActionBar
- TabWidget
- ViewPager
- Tab
Which of the following codes is used to enable a split action bar on an activity?
-
xml <activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBar”> </activity> -
xml <activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> </activity> -
xml <activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarNarrow”> </activity> -
xml <activity> android:name=”.SampleActivity” android:Options=”splitActionBarWhenNarrow”> </activity>
In ___________, the user drags the entire display on the left to the right to switch pages.
- TabHost
- TabWidget
- ViewPager
- ActionBar
Which of the following statements is/are correct?
A. The getCount() returns the number of items in the pages.
B. The. getItem() returns the fragment at the specified position.
- Only A
- Only B
- Both A and B
- Neither A nor B
How can we add the tabs and their listeners to the action bar?
-
java Tab t1=bar.newTab(); t1.setText("Tab Text&"); -
java Tab t1=bar.newTab(); t1.setTabListener(this); -
java Tab t1=bar.newTab(); t1.setText("Tab Text"); t1.setTabListener(this); -
java Tab t1=bar.newTab(); t1.setText("Tab Text"); t1.setTabListener(this); bar.addTab(bar.newTab());
What is the correct sequence to create a tab-style interface?
- TabHost
- TabWidget
- LinearLayout
- 123
- 321
- 132
- 312
Which of the following codes will create a tabbed interface?
-
java Android:actionProviderClass=”android.widget.ShareActionProvider” -
java Public void onCreate(Bundle bun1) { Super.onCreate(bun1); final ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); } -
java Public void onCreate(Bundle bun1) { Super.onCreate(bun1); final ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_TABS); } -
java Public void onCreate(Bundle bun1) { Super.onCreate(bun1); final ActionBar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); }