标签:blog java os div cti log new sp on
1.点击返回键,提示用户是否要退出
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { AlertDialog.Builder dialog = new AlertDialog.Builder(WXEntryActivity.this); dialog.setTitle("退出"); dialog.setMessage("点击确定退出应用"); dialog.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { System.exit(0); } }); dialog.setNegativeButton("取消", null).show(); } return false; }
标签:blog java os div cti log new sp on
原文地址:http://www.cnblogs.com/clarence/p/3933618.html