How to create an Overflow menu and combine it with an option menu ? "android" -


hi guys new in android development want ask how can create overflow menu 2 items , how can combine option menu did looks this

public class mainactivity extends activity {   @override public boolean oncreateoptionsmenu(android.view.menu menu) {     super.oncreateoptionsmenu(menu);     menuinflater blabla = getmenuinflater();     blabla.inflate(r.menu.options_menu ,menu);     return true;   } @override public boolean onoptionsitemselected(menuitem item) {     switch(item.getitemid()){         case r.id.oursponsors:             intent = new intent("com.--.------.------");             startactivity(i);             break;          case r.id.exit:             finish();             break;      }     return false; } 

xml

 <item android:title="our sponsors" android:id="@+id/oursponsors" android:icon="@drawable/image" />   <item         android:title="exit"         android:id="@+id/exit"         android:icon="@drawable/exit"            /> 

i beginner guys if can give me full tutorial showing how create overflow menu awesome ! in advance !

here developer page related http://developer.android.com/guide/topics/resources/menu-resource.html.

you want add android:showasaction="collapseactionview" (or android:showasaction="never" depending on api level) each menu item in xml layout


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -