2.Android中如何去添加menu菜单

 1 @Override
2 public boolean onCreateOptionsMenu(Menu menu) {
3 // TODO Auto-generated method stub
4 menu.add(1, 1, 1, "设置");
5 return super.onCreateOptionsMenu(menu);
6 }
7 @Override
8 public boolean onMenuItemSelected(int featureId, MenuItem item) {
9 // TODO Auto-generated method stub
10 if(item.getItemId() == 1){
11 finish();
12 }
13 return super.onMenuItemSelected(featureId, item);
14 }
posted @ 2012-03-14 09:41  ConquerMobileApp  阅读(338)  评论(0编辑  收藏  举报