Android action bar - disable options menu

Gabriel Janucik picture Gabriel Janucik · Nov 22, 2014 · Viewed 9.3k times · Source

How can I disable options menu item from my action bar?

I made my own custom bar, for display *.png logo, but i don't want to display three dots button of options menu.

I've tried to find some solution, but nothing works.

Answer

Y.S picture Y.S · Nov 22, 2014

Code Monkey's answer will do what you want, but as a side effect it will also not allow you to add ANY action items to the Action Bar at all. I believe the correct answer is

@Override
public boolean onPrepareOptionsMenu (Menu menu) {
    return false;
}

This is what you want.