@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0,1,1,R.string.about);
menu.add(0,2,2,R.string.exit);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == 2) {
finish();
}
return super.onOptionsItemSelected(item);
}
本文出自 “天南一方” 博客,请务必保留此出处http://phpnan.blog.51cto.com/2641199/1654128
原文地址:http://phpnan.blog.51cto.com/2641199/1654128