
Problem : after updating the support library and using toolbars, the overflow menu button is always displayed on devices with and without a hardware menu button
What I need : I want the overflow menu button to appear only when the device does not have a hardware menu button
menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_settings" app:showAsAction="never" android:title="@string/action_settings"/> <item android:id="@+id/import_data" app:showAsAction="never" android:title="@string/import_data"/>
in action (ActionBarActivity)
@Override public boolean onCreateOptionsMenu(Menu menu) {
and in onCreate: setSupportActionBar (mToolbar);
Help will be appreciated!
source share