Android系列之UI组件----Menu菜单

嵌入式系统 时间:2016-09-12来源:网络

29 @Override

30 public boolean onOptionsItemSelected(MenuItem item) {

31 // Handle action bar item clicks here. The action bar will

32 // automatically handle clicks on the Home/Up button, so long

33 // as you specify a parent activity in AndroidManifest.xml.

34 switch (item.getItemId()) {

35 case R.id.start:

36 Toast.makeText(this, 开始游戏, Toast.LENGTH_SHORT).show();

37 break;

38 case R.id.over:

39 Toast.makeText(this, 结束游戏, Toast.LENGTH_SHORT).show();

40 break;

41

42 default:

43 break;

44 }

45 return super.onOptionsItemSelected(item);

46 }

47 }

1 2

关键词:

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版