ActivityGroup 单击meun键没反应
在Activity里面加入了以下二个重写方法单击menu键没有任何反应,当在没有ActivityGroup页面一切正常显示
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
return super.onCreateOptionsMenu(Popup_menu.CreateOptionsMenu(menu));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(Popup_menu.OptionsItemSelected(item, context));
}
在上找到代码只须在 ActivityGroup类中加入
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
this.finish();
}
else if(keyCode==KeyEvent.KEYCODE_MENU)
{
this.getLocalActivityManager().getCurrentActivity().openOptionsMenu();
}
return super.onKeyDown(keyCode, event);
}
运行测试 正常显示