Disable popup on ActionBar which has a settings menu item

My action bar has this button in the top right corner:

enter image description here

And when I click on it, it gives me a settings menu item that does nothing when clicked:

enter image description here

I want to disable the button in the first image (looks like an ellipsis but rotated) from my ActionBar.

How would I do it?

+3


source to share


2 answers


This is the default overflow menu that is installed by the SDK when you create a new Android project.



To disable the menu, you just need to remove the code that adds it. You must have a method onCreateOptionsMenu()

overridden somewhere in your activity that you can remove.

0


source


selects a context menu item

@Override
    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
            return false; // Return false if nothing is done
}

      



more details here - http://developer.android.com/guide/topics/ui/menus.html#context-menu

0


source







All Articles