6

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?

A. Zalonis
  • 1,599
  • 6
  • 26
  • 41
  • 1
    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." If you're developing for Android 2.3 or lower, users can reveal the options menu panel by pressing the Menu button. On Android 3.0 and higher, items from the options menu are presented by the action bar as a combination of on-screen action items and overflow options. Beginning with Android 3.0, the Menu button is deprecated. – hitesh141 May 22 '15 at 05:53

4 Answers4

1

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

Spit
  • 83
  • 1
  • 9
  • I am reading this site. But the menu which I have created doesnt like this site menus. I can understant what make wrong. Please check again my post I editded just now. I added screen shots too. – A. Zalonis Sep 15 '13 at 14:28
  • Alright, sorry I misunderstood. What you're looking for is something that was part of API level 10 and below. The problem with that is that your app will look "old" and some feature of higher level APIs won't be available to you unless you use the support libraries(for example the SwipeView your using) but if you're sure you want that then change your target SDK level to 10 (Gingerbread) – Spit Sep 15 '13 at 15:01
1

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

Metalhead1247
  • 1,978
  • 1
  • 17
  • 28
1

add the following line after onCreat.

        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.home_screen);
Numan Ahmad
  • 157
  • 1
  • 4
  • 14
1

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.

Sean C.
  • 23
  • 5