安卓—自定义alert弹出窗口

Posted zhouxuezheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安卓—自定义alert弹出窗口相关的知识,希望对你有一定的参考价值。

 默认用法

public void alertDialog(View view) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("弹出窗");
        builder.setMessage("提示信息!");
        builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                System.out.println("确认执行函数");
            }
        }).setNegativeButton("取消", null);
        builder.show();
    }

以上是关于安卓—自定义alert弹出窗口的主要内容,如果未能解决你的问题,请参考以下文章