Search code examples
androidsettingstoolbar

How to remove settings in the toolbar?


How to remove Settings

I want to remove only the setting points without affecting other properties in the toolbar. What can I do here is part of my manifest:

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.AppBarOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main_met_calc" />


Solution

  • just delete the first entry in the menu.xml

    The path where's menu.xml is app/src/main/res/menu

    the item xml will look like this

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