目前,当用户打开我的应用程序时,会AlertDialog打开询问他们是否要升级到专业版.我需要添加一个CheckBox,AlertDialog这将使应用程序不再显示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();
Run Code Online (Sandbox Code Playgroud)
如果有人能告诉我如何将添加CheckBox到AlertDialog,这将使应用不再显示AlertDialog当用户打开应用程序,这将是巨大的.提前致谢!