android AlertDialog 弹出框

AlertDialog alertDialog2 = new AlertDialog.Builder(ManeuWebActivity.this)
        .setTitle("提示")
        .setMessage("最新版本号为:" + newVersion+"\n版本大小为:"+pacageSize)
        .setNegativeButton("暂不更新", new DialogInterface.OnClickListener() {//添加取消
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                //Toast.makeText(ManeuWebActivity.this, "这是取消按钮", Toast.LENGTH_SHORT).show();
            }
        })
        .setPositiveButton("立即更新", new DialogInterface.OnClickListener() {//添加"Yes"按钮
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                download(versionUpdateURL);   
            }
        })
        .create();
alertDialog2.setCancelable(false);//点击空白处之后弹出框不会消失
alertDialog2.show();

你可能感兴趣的:(android AlertDialog 弹出框)