0
Alien head

Android Framework

Description: View Framework 3
Number of Questions: 15
Created by:
Tags: View Framework 3 Android Framework Overview
Attempted 0/15 Correct 0 Score 0

The ___________ is automatically added to your app if it is using one of the Holo themes.

  1. Menu bar

  2. Title bar

  3. Toolbar

  4. Toolbar


Correct Option: D
Explanation:

The action bar is automatically added to your app if it is using one of the Holo themes. Theme Holo is the default for all apps in Android 3.0.

Which of the following Android versions does not support action bar API?

  1. Android 4.0

  2. Android 3.0

  3. Android 4.2.2

  4. Android 2.0


Correct Option: D
Explanation:

Action bar API is not available on android versions before 3.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.

  1. withText

  2. ifRoom

  3. ifNotRoom

  4. withRoom


Correct Option: B
Explanation:

It is recommended that the android:showAsAction attributes to ifRoom, which will display the menu item as an action item only if there is enough room on the display. On a small size screen, the actions will  collapse into the overflow menu.

What is the working of the following code?

android:showAsAction=”collapseActionView”

  1. This will collapse the action view into just an action item.

  2. This will completely collapse the action view.

  3. This will completely collapse the action item.

  4. The search widget would consume space on the action bar even when it is not in use.


Correct Option: A
Explanation:

The given code will collapse the action view into just an action item. Otherwise, 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

  1. ShareService

  2. ShareServiceProvider

  3. ShareActionProvider

  4. Sharing


Correct Option: C
Explanation:

.

When we have a large number of navigation options, then which of the following modes is suitable?

  1. Tab navigation mode

  2. Viewpager

  3. List navigation mode

  4. Tabwidget


Correct Option: C
Explanation:

List navigation mode is a good choice when the number of possible navigation options are too large to make tabs practical.

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.

  1. Only A

  2. Only B

  3. Both A and B

  4. Neither A nor B


Correct Option: C
Explanation:

ActionProvider is a new class available in Android 4.0. The action bar is a way to quickly add functionality to your application, while maintaining a native platform look and feel. Hence, both statements are correct.

Which of the following interfaces/classes is used to implement/define the methods onTabSelected, TabUnselected and onTabReselected?

  1. ActionBar

  2. ActionBarListener

  3. ActionProvider

  4. TabListener


Correct Option: D
Explanation:

TabListener is used to implement the methods onTabSelected, onTabUnselected and onTabReselected.

Which of the following classes is used to add the tabs to a subview of your app?

  1. ActionBar

  2. TabWidget

  3. ViewPager

  4. Tab


Correct Option: B
Explanation:

If you need to add tabs to a sub-view of your app, you can create a tab-style interface by using a TabWidget.

Which of the following codes is used to enable a split action bar on an activity?

  1. 
    
    android:name=”.SampleActivity” android:uiOptions=”splitActionBar”> 
    
    
  2. 
     android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> 
    
  3. 
     android:name=”.SampleActivity” android:uiOptions=”splitActionBarNarrow”> 
    
  4.  android:name=”.SampleActivity” android:Options=”splitActionBarWhenNarrow”> 
    

Correct Option: B
Explanation:

To enable a split action bar on an activity, the code is:


android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> 

In ___________, the user drags the entire display on the left to the right to switch pages.

  1. TabHost

  2. TabWidget

  3. ViewPager

  4. ActionBar


Correct Option: C
Explanation:

.

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.

  1. Only A

  2. Only B

  3. Both A and B

  4. Neither A nor B


Correct Option: B
Explanation:

The getCount() returns the total number of fragments in the pages and the getItem() returns the fragment at the specified position.This method will be called as the user scrolls through the pages.

How can we add the tabs and their listeners to the action bar?

  1.      Tab t1=bar.newTab();
          t1.setText("Tab Text&");
    
  2.     Tab t1=bar.newTab();
        t1.setTabListener(this);
    
  3.             Tab t1=bar.newTab();
                t1.setText("Tab Text");
                t1.setTabListener(this);
    
  4.            Tab t1=bar.newTab();
                t1.setText("Tab Text");
                t1.setTabListener(this);
                bar.addTab(bar.newTab());
    

Correct Option: D
Explanation:

The code to add the tabs and their listeners to the action bar is as follows:

            t1.setText("Tab Text");
            t1.setTabListener(this);
            bar.addTab(bar.newTab());

What is the correct sequence to create a tab-style interface?

  1. TabHost
  2. TabWidget
  3. LinearLayout
  1. 123

  2. 321

  3. 132

  4. 312


Correct Option: C
Explanation:

The correct sequence to create a tab-style interface is:

1.TabHost

2. LinearLayout 3. TabWidget

Which of the following codes will create a tabbed interface?

  1. Android:actionProviderClass=”android.widget.ShareActionProvider”
    
  2. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar bar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }
    
  3. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar bar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_TABS);
    }
    
  4. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }
    

Correct Option: D
Explanation:

To create a tabbed interface, you have to set the navigation mode for the action bar in the onCreate method of your activity. The code is:

Public void onCreate(Bundle bun1) {
 Super.onCreate(bun1);
 final ActionBar bar = getActionBar();
 bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
+ View questions