开发者

Android OnCreateOptionsMenu

开发者 https://www.devze.com 2023-03-27 02:34 出处:网络
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 th

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:

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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消