Question

I have an issue that I'm finding difficult to troubleshoot. I've created an app where I have the menu setup as such:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.brainbox.dropnotelitealpha.app.MainActivity" >

  <item
    android:id="@+id/action_settings"
    android:title="@string/action_settings"
    android:orderInCategory="1"
    android:showAsAction="never"/>

    <item android:id="@+id/action_logout"
        android:title="Logout"
        android:orderInCategory="2"
        android:showAsAction="never" />
</menu>

I can access the items by pressing on the overflow icon in the ActionBar. The problem I have is that when I test the app on a Samsung S4, the overflow icon does not display. If I use an emulator, or any other device, the overflow displays as desired.

Does anyone have any ideas what may prevent the menu from displaying? Oh, it's only when menu items are set to android:showAsAction="never".

TIA

Was it helpful?

Solution

Change your code to this and see if it's fixed:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.brainbox.dropnotelitealpha.app.MainActivity" >

  <item
    android:id="@+id/action_settings"
    android:title="@string/action_settings"
    android:orderInCategory="1"
    android:showAsAction="ifRoom"/>

    <item android:id="@+id/action_logout"
        android:title="Logout"
        android:orderInCategory="2"
        android:showAsAction="ifRoom" />
</menu>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top