lesson7 android studio alert dialog 的使用

alert dialog

              AlertDialog.Builder alert_dialog= new AlertDialog.Builder(MainActivity.this);
                    alert_dialog.setTitle("溢出");
                    alert_dialog.setMessage("已经达到100");
                    alert_dialog.setCancelable(false);
                    alert_dialog.setPositiveButton("ok", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {

                        }
                    });

                    alert_dialog.setNegativeButton("cancle", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {

                        }
                    });
                    alert_dialog.show();

你可能感兴趣的:(lesson7 android studio alert dialog 的使用)