目前,当用户打开我的应用程序时,会弹出一个AlertDialog
,询问他们是否想升级到专业版。
我需要在AlertDialog
中添加一个CheckBox
,使得当用户打开应用程序时不再显示AlertDialog
。
这是我现在的AlertDialog
:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(" MY_TEXT");
builder.setMessage(" MY_TEXT ")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Uri uri = Uri.parse("market://details?id=MY_APP_PACKAGE");
Intent intent = new Intent (Intent.ACTION_VIEW, uri);
startActivity(intent); }
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).show();
如何在 AlertDialog
中添加一个 CheckBox
,使得当用户打开应用程序时,勾选该选项后就不再显示 AlertDialog
?