Android 开发笔记 “弹出框”

AlertDialog.Builder builder = new AlertDialog.Builder(Activity.this);
builder.setMessage("Are you sure you want to exit?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// MyActivity.this.finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
上一篇:Python菜鸟之路:Python基础-模块


下一篇:AAABBBBCCCC