tobias
tobias

Reputation: 2362

Android 4.1.2 does not show menu button

My app provides a menu which can be reached by clicking the Android menu button. As Google removed the hardware menu button since 3.0 there is a software emuated button (typically 3 dots) on the screen to access the menu.

A lot of users with a Google Nexus phone complain now that since they updated to 4.1.2 that the menu button does not appear.

Here the code:

@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(0, 0, Menu.NONE, this.getString(R.string.setting));
        menu.add(0, 1, Menu.NONE, this.getString(R.string.config));
        return super.onCreateOptionsMenu(menu);
    }

What do I have to change to bring the button back also on 4.1.2?

Upvotes: 2

Views: 8472

Answers (2)

Teovald
Teovald

Reputation: 4389

The correct solution to this problem is to implement an ActionBar (ActionBarSherlock is a good option if you want to harmonise the look & feel of your app accross Android versions) :

  • Android 3.0 & superior : no menu button, corresponding options accessible in the actionbar & overflow menu.
  • Earlier versions : use the menu button to access to the corresponding actions.

Upvotes: 2

Damien Praca
Damien Praca

Reputation: 3136

I had the same problem on tablets and now it seems to be generalized to phones also. The only solution is either to add an ActionBar (you'll get then you menu entries in it automatically) or to make the android:targetSdkVersion below 11.

Upvotes: 8

Related Questions