默认用法
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(); }