我想Option Menu为Android制作,我访问过这个网站.在他们的脚本中,我发现onPrepareOptionsMenu,我尝试使用Android 2.3.3编译器进行编译和运行onPrepareOptionsMenu,无论是否有效,但我没有看到任何区别.
public boolean onCreateOptionsMenu(Menu menu){
//code here
}
public boolean onOptionsItemSelected(MenuItem item){
//code here
}
public boolean onPrepareOptionsMenu(Menu menu){
//code here
}
Run Code Online (Sandbox Code Playgroud)
实际上是什么onPrepareOptionsMenu方法呢?这种方法很重要吗?我可以删除方法吗?
加成
哦,我也听说过Action Bar在Android 3.0中,它说Action Bar是make的替代方式Option Menu,并且它正在使用onPrepareOptionsMenu.是对的吗?
谢谢...