Reputation: 183
I'm confused as to why it returns a boolean here when within the last line of code. What's the use of this and why does it matter?
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu);
}
Upvotes: 0
Views: 1791
Reputation: 730
From documentation for this method:
Returns boolean You must return true for the menu to be displayed; if you return false it will not be shown.
To my understanding, this is to confirm that menu was created correctly, it is populated only with valid elements, so it can safely be used.
Upvotes: 1