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
First you need to define a layout that contains the message and checkbox for disabling the alert on subsequent views. Then instead of calling builder.setMessage
, you'll call:
builder.setView(myAlertViewWithDisablingCheckbox);
Then when the user clicks on the alert dialog button, you'll have to check to see if that checkbox has been checked, and save that preference in your app's SharedPreferences
. Then you can use that preference to determine if this alert dialog should be shown to the user again.