Code example for Spinner

Methods: getSelectedItemPosition

0
            // first, get rid of our menus (if any) 
        menu.removeItem(0);
        menu.removeItem(1);
         
            // next, add back item(s) based on current menu mode 
        switch (mMenuMode.getSelectedItemPosition())
        { 
        case MENUMODE_SEARCH_KEY:
            item = menu.add( 0, 0, 0, "(Search Key)");
            break; 
             
        case MENUMODE_MENU_ITEM:
            item = menu.add( 0, 0, 0, "Search");
            item.setAlphabeticShortcut(SearchManager.MENU_KEY);
            break; 
             
        case MENUMODE_TYPE_TO_SEARCH:
            item = menu.add( 0, 0, 0, "(Type-To-Search)");
            break; 
             
        case MENUMODE_DISABLED: