Android 退出提示框 代码

转自:http://hi.baidu.com/ittdt/item/d932cf37f486f886c3cf29ea

new AlertDialog.Builder(MainEngine.context)
    //.setTitle("提示")
    .setMessage("确定要退出游戏吗?")
    .setPositiveButton("确定", new DialogInterface.OnClickListener() {
     @Override
     public void onClick(DialogInterface arg0,
       int arg1) {
      // TODO Auto-generated method stub
      // finish();
      android.os.Process.killProcess(android.os.Process.myPid());
     }
    })
    .setNegativeButton("取消", new DialogInterface.OnClickListener() {
     @Override
     public void onClick(DialogInterface arg0,
       int arg1) {
      // TODO Auto-generated method stub
     }
    }).show();

posted on 2014-06-18 21:24  打油小牧童  阅读(245)  评论(0编辑  收藏  举报

导航