AlertDialog

 

AlertDialog

public void onClick(View v) {

    new AlertDialog.Builder(MainActivity.this)

            .setTitle("This is Dialog~")//title

            .setMessage("Are you sure?")//text

            .setCancelable(false)//'false' is you can't cancel the Dialog;

            .setPositiveButton("Ojbk", new DialogInterface.OnClickListener() {

                @Override

                public void onClick(DialogInterface dialog, int which) {

                   

                }

            })

            .setNegativeButton("No",null)

            .setNeutralButton("don't care",null)//一般按钮,点击关闭使用

            .show();

}