Currently when the user opens my app, an AlertDialog
opens, asking them if they would like to upgrade to the pro version.
I need to add a CheckBox
to the AlertDialog
that will make the app no longer show the AlertDialog
when the user opens the app.
Here is what I have for the AlertDialog
now:
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();
How do I add a CheckBox
to the AlertDialog
that will make the app no longer show the AlertDialog
when the user opens the app?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…