Creating an Options Menu in Android

I'm trying to make an option menu in android like this link http://developer.android.com/guide/topics/ui/menus.html#options-menu

but my developed menu shows not on bottom of my page but in top action bar.

my xml is bellow my_options_menu.xml

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/new_game"
          android:icon="@drawable/menu_addnew"
          android:title="Νέο"
          android:showAsAction="ifRoom"/>
    <item android:id="@+id/help"
          android:icon="@drawable/menu_addnew"
          android:title="Βοήθεια" />
</menu>

and my java code is

   @Override
    public boolean onCreateOptionsMenu(Menu menu){

         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.my_options_menu, menu);
          return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
            case R.id.new_game:
                //newGame();
                return true;
            case R.id.help:
                //showHelp();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

What can I do to show the menu on bottom of my application and not on top action bar?

My menu showes in below image

I want create menu like below image

How can do that? Can someone help me?

Answers


This page should answer any questions you have: http://developer.android.com/guide/topics/ui/actionbar.html under "Using split action bar" should be all the information you need to add the menu items to the bottom of your page


Change your Target Sdk Level to 10 or below.

You seem to be using Jelly bean where the menu option by default is at Top.

The menu you have shown is of Gingerbread style Menu.

or try to

set the activity theme to Theme.Holo.NoActionBar

Right click on your project > properties> select Android > Right side you can select your target

or change the minSdkversion and target from Android manifest file


add the following line after onCreat.

        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.home_screen);

The reason this is showing in the action menu is because you have android:showAsAction="ifRoom" in your xml file. remove that and you should be good.


Need Your Help

Convert all EOL (dos->unix) of all files in a directory and sub-directories recursively without dos2unix

linux bash unix command-line end-of-line

How do I convert all EOL (dos->unix) of all files in a directory and sub-directories recursively without dos2unix? (I do not have it and cannot install it.)

Use params of loadNetzkeComponent in configuration

javascript ruby netzke

Is it possible to pass extra parameters to "loadNetzkeComponent" and use them in the compnent configuration?