【发布时间】:2013-02-05 21:17:06
【问题描述】:
我正在使用onCreateOptionsMenu,并且有一个我没有编程的默认菜单项。我想删除它,因为我没有用它,它也没有做任何事情。这是它的样子:
我想去掉“设置”项。
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(1, 1, 0, "item1");
menu.add(1, 2, 1, "item2");
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_name, menu);
return true;
}
如您所见,我并没有自己手动添加。我该如何摆脱它?
【问题讨论】:
标签: android oncreateoptionsmenu