wmose.blogg.se

Android studio fragment action bar
Android studio fragment action bar









So to create our drop down navigation list we need simply populate a spinner. We know a Spinner is android view that displays one time at time and user can select one item among a list of items. The drop down list is implemented like a Spinner. In other words we have to create a menu with different items.

android studio fragment action bar

We need to create a list of item corresponding to the action we want to support. Where at line 4 we enable our navigation type.

android studio fragment action bar

If we look at the code generated we notice: // Set up the action bar to show a dropdown list.įinal ActionBar actionBar = getActionBar() ĪtDisplayShowTitleEnabled(false) ĪtNavigationMode(ActionBar.NAVIGATION_MODE_LIST) To enable the drop down navigation we have to get the Actionbar reference and the set the navigation type we want, in our case NAVIGATION_MODE_LIST.











Android studio fragment action bar