Base class for Dialogs.
子类 AlertDialog
A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method.
If you want to display a more complex view.
直接创建时,提示:‘AlertDialog(android.content.Context)’ has protected access in ‘android.app.AlertDialog’
使用内部类 AlertDialog.Builder创建
mContext=this;
AlertDialog.Builder dialog=new AlertDialog.Builder(mContext);
dialog.setTitle("");
dialog.setMessage("");
dialog.setPositiveButton("", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
// 重点
dialog.show();
// dialog.setNegativeButton();
// dialog.setNeutralButton();
int checkedItem = 0;