3

I'm developing an app with a Navigation Drawer. But in the top right corner there is always the menue with the tab "Settings". How can I remove that menue as well in the drawer as in the normal view?

Validor
  • 71
  • 3
  • 7

5 Answers5

6

First of all delete the main.xml file under the directory

"project name"\app\src\main\res\menu

and it should look like this image.

Then, remove a block of code that is in relation to that of the main.xml file. It should be located under the MainActivity or the activity where you are seeing the "Settings". Refer to this image.

You can also delete the string resource under strings.xml file which is named "action_settings" by default.

That is all and your project is clear from what you want to get rid off.

Trigary
  • 366
  • 4
  • 14
arvicxyz
  • 381
  • 3
  • 13
2

Just remove that item from a file called menu_main.xml in menu folder. It is always generated as default when creating a new project in Android Studio.

The xml should look something like this:

<menu xmlns:android="http://schemas.android.com/apk/res/android">

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

</menu>
Hussein El Feky
  • 6,627
  • 5
  • 44
  • 57
0

I think you may be talking about the action bar, not the navigation drawer. If this is the case, then if you get rid of the onCreateOptionsMenu and onOptionsItemSelected methods in your activity, the Settings menu item will disappear.

As for the whole action bar, I think this might help.

Community
  • 1
  • 1
Shahzad
  • 2,033
  • 1
  • 16
  • 23
0

delete settng menu from the menu_main.xml which indicate in res>menu

0

Remove the item tag from menu tag, which is present on main.xml, then remove corresponding ID from Activity.java file.

Manisa
  • 1
  • 1