默认用法
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(); }
原文地址:https://www.cnblogs.com/zhouxuezheng/p/11814040.html
时间: 2024-10-22 06:05:33