Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 enter image description here

I want create menu like below image

enter image description here

How can do that? Can someone help me?

like image 384
A. Zalonis Avatar asked Sep 15 '13 14:09

A. Zalonis


People also ask

What is Android option menu?

The options menu is the primary collection of menu items for an activity. It's where you should place actions that have a global impact on the app, such as "Search," "Compose email," and "Settings." See the section about Creating an Options Menu.

What is option menu in mobile application development?

Android Options Menu is a primary collection of menu items in an android application and is useful for actions that have a global impact on the searching application.

Where is the option menu?

In Android, an Option Menu is a set of primary options of an application which users can select one of the options to perform an action. The Option Menu appears on the right side of the App Bar.


1 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

like image 174
Spit Avatar answered Dec 11 '22 04:12

Spit