How to disable/hide three-dot indicator(Option menu indicator) on ICS handsets which does't have menu button. ?
I am running application as <uses-sdk android:minSdkVersion="5"/>
in Manifest, code is compiled with 4.0
. Three-dot indicator shows on every screen.
Example for preference activities i don't want show Three-dot indicator, since it does't have any menu options.
Adding android:targetSdkVersion="14"
in manifest it works. However don't want hide/remove three dots button on all screens . Only in preference activities don't want to show this three dots button.
override method and return false remember of not call super
Way too late to the party here, I was trying to remove all my menu items and the 3-dots(option menu indicator), I did differently than the solution given here I am surprised that nobody had told it. There is a visibility tag that can be set to false and no changing of code in activity is required
visibility=false
does the trickin res / menu /..
Do it like this.
I am checking if my navigation drawer is visible I will hide the menu and vice versa. You can use it according to you requirement. Hope this helps. Happy Coding. :)
Just want to improve @war_hero answer. If You wanna set the visibility on run time You can use oncreateoptions menu parameter like this
and then make a function to show or hide any menu item according to the index. for e.g.
Copy paste this code in main.xml in menu folder you just need to make the item android:visible="false"
Following code worked for my app. Tried on Samsung Galaxy S4 (Android 4.3) and Nexus 4 (Android 4.2):