AlertDialog

xiaoxiao2021-04-16  44

 

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();

}

转载请注明原文地址: https://www.6miu.com/read-4818091.html

最新回复(0)