Victor KP
Victor KP

Reputation: 437

Android OnCreateOptionsMenu

I've made menu's before, so I'm not a complete rookie, but I've encountered a problem where Eclipse tells me I have to remove @Override, but obviously if I do then my code won't run to inflate the menu. the code is:

@Override
public boolean OnCreateOptionsMenu(Menu menu){
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(R.menu.map_menu, menu);
   return super.onCreateOptionsMenu(menu);
}

Upvotes: 1

Views: 2943

Answers (2)

M_K
M_K

Reputation: 3455

You can add overridden methods in eclipse by going Source > Override/implement methods and then check the methods you want to override,it helps with the spelling and all.

Upvotes: 4

Matt
Matt

Reputation: 5511

The "on" in "OnCreateOptionsMenu" should not be capitalized

Upvotes: 9

Related Questions