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?
-
1can you post screenshot? – Malwinder Singh Oct 10 '15 at 14:51
-
Just remove that item from a file called menu_main.xml. It is always generated as default when creating a new project. – Hussein El Feky Oct 10 '15 at 14:56
5 Answers
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.
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>

- 6,627
- 5
- 44
- 57
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.
Remove the item tag from menu tag, which is present on main.xml, then remove corresponding ID from Activity.java file.

- 1
- 1