我像往常一样使用这个Theme.Dialog进行对话活动。然后,我添加一个像这样的选项菜单......
// menu on actionbar part
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_actionbar,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// handle item selection
switch (item.getItemId()) {
case R.id.menu_add:
Intent myIntent = new Intent(Main.this, Add.class);
startActivity(myIntent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
但是当我运行它时,选项菜单消失了。我该如何解决?
谢谢; p