1

I'm new in Android. I want to develop a page with action bar overflow menus. My emulator shows it correctly.Bt I can't see it in phone. phone with 4.1.2 Android version Please help me....

Android manifest

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity... 

Style.xml

<!-- Application theme. -->` <style name="AppTheme" parent="android:style/Theme.Holo.Light"> <item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item> </style> <style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow"> <item name="android:src">@drawable/settings</item> </style>`

Menu.xml

<menu xmlns:android="schemas.android.com/apk/res/android"; <item android:id="@+id/action_instructions" android:orderInCategory="100" android:showAsAction="never" android:onClick="doInstructions" android:title="@string/action_instructions"/> </menu>
Szymon
  • 42,577
  • 16
  • 96
  • 114
ammu
  • 11
  • 3

3 Answers3

2

If you phone has a hardware menu button, the overflow button in the actionbar gets hidden.

There is a workaround for this behavior available at https://stackoverflow.com/a/11438245/2907424.

Community
  • 1
  • 1
ov3rk1ll
  • 391
  • 2
  • 8
  • Then how can I show these (logout, about,intructions) using my app.Here I gave important menus in overflow menu.It will not appear means my app willn't satisfy the customer.Plz help – ammu Oct 23 '13 at 12:05
  • If their phone has a menu button, they'll have to press it in order to show the menu. If you add the code from the link, the overflow button in the actionbar will show up even if the phone has a hardware menu button. – ov3rk1ll Oct 23 '13 at 13:07
  • I have verified ov3rk1ll comment - the action overflow is not shown on galaxy S3, while it shows on Nexus 5 and galaxy note 3. – Qylin Mar 31 '14 at 10:48
1

Some phones don't show the overflow buttons as the menu button is used on them to access the overflow menu. This is for instance the case with Samsung phones as Samsung modified the Android system to certain things like that in a different way to vanilla Android phones.

It is debatable whether you should change that behavior. On one hand, this will make it consistent with Android standards. On the other hand, users of those phones with no overflow button are used to using the menu button and this behaviour is consistent for them.

Szymon
  • 42,577
  • 16
  • 96
  • 114
  • Then how can I show these (logout, about,intructions) using my app.Here I gave important menus in overflow menu.It will not appear means my app willn't satisfy the customer.Plz help – ammu Oct 23 '13 at 12:04
  • You can use the menu button. I personally use a Samsung phone and I'm used to doing that. I would leave it as it is and let the phone decide how it behaved but it is obviously your choice. – Szymon Oct 23 '13 at 12:11
0

Which phone do you have?

If your phone has a hardware/capacitive menu button the menu overflow button is hidden by the OS.

i5h4n
  • 387
  • 1
  • 11
  • @ammu So it has a capacitive button for menu hence the overflow button is hidden. Test your app on a Nexus 4 or any device without these capacitive buttons and the overflow button will show. – i5h4n Oct 23 '13 at 12:01
  • Then how can I show these (logout, about,intructions) using my app.Here I gave important menus in overflow menu.It will not appear means my app willn't satisfy the customer.Plz help – ammu Oct 23 '13 at 12:05
  • Your added menu can still be accessed by pressing the menu button on the phones which have a menu button. For phones like Nexus 4 the overflow button would appear. – i5h4n Oct 23 '13 at 12:07