1

The new android smartphones have no menu settings button. Instead, the settings icon is in the ActionBar.

If I run my app on an old smartphone, there is no settings icon in the actionbar. You have to click at the menu settings button of the smartphone.

How can I enforce at older smartphones (APIs) that the settings icon is also in the ActionBar?

Stampy
  • 456
  • 7
  • 27

1 Answers1

2

What you describe is actually intended by design as per the Backwards compatibility section of the Android Design Guide.

Android phones with traditional navigation hardware keys don't display the virtual navigation bar at the bottom of the screen. Instead, the action overflow is available from the menu hardware key

A quote from a previous answer explains why you shouldn't be concerned with this behaviour:

Ultimately it's more important to the user experience that your app behave consistently with every other app on the same device, than that it behave consistently with itself across all devices. - (source)

However, if you are still adamant you wish to see the same UI across all devices you can consider the following:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@+id/menu_overflow"
        android:icon="@drawable/overflow_image"
        android:orderInCategory="11111"
        android:showAsAction="always">
        <menu>
            <item
                android:id="@+id/settings_item"
                android:showAsAction="never"
                android:title="@string/settings"/>
        </menu>
    </item>  
</menu>

This example would use a drawable resource overflow_image, as the 'three dots' and always show on the toolbar and behave as you require. You would just need to source the correct drawable

Community
  • 1
  • 1
Ed Holloway-George
  • 5,092
  • 2
  • 37
  • 66