提示类 alertDialog

public void showAD(View view){
        new AlertDialog.Builder(this)
                .setTitle("删除数据") // 设置标题
                .setMessage("你确定删除数据吗")
                .setPositiveButton("删除", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                Toast.makeText(DialogDemo.this, "删除数据", Toast.LENGTH_SHORT).show();
            }
        }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                Toast.makeText(DialogDemo.this, "取消删除数据", T

Guess you like

Origin blog.csdn.net/weixin_38107457/article/details/120517357