public boolean onMenuItemSelected(int featureId, MenuItem item) { switch (item.getItemId()) { case Menu.FIRST + 1: // 这里就是设置弹出对话框的地方 new AlertDialog.Builder(YcMusicPlay.this) .setIcon(R.drawable.dialog_information).setTitle("关于") .setMessage(R.string.about).setPositiveButton("确定", null) .show(); break; case Menu.FIRST + 2: new AlertDialog.Builder(YcMusicPlay.this) .setIcon(R.drawable.dialog_information) .setTitle("提示") .setMessage("你确定要退出Yc音乐吗?") .setPositiveButton("确定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { /* 在这里设计当对话框按钮单击之后要运行的事件 */ stopService(new Intent(YcMusicPlay.this, YcMusicService.class)); System.exit(0); } }).setNegativeButton("取消", null).show(); break; } return false; }
最后
以上就是耍酷钥匙最近收集整理的关于MENU菜单的设计的全部内容,更多相关MENU菜单内容请搜索靠谱客的其他文章。
发表评论 取消回复