I am trying to make a popup dialog that only shows after the app\'s first run that will alert users of the new changes in the app. So I have a dialog popup like this:
<
Use SharedPreferences to store the isFirstRun value, and check in your launching activity against that value.
If the value is set, then no need to display the dialog. If else, display the dialog and save the isFirstRun flag in SharedPreferences.
Example:
public void checkFirstRun() {
boolean isFirstRun = getSharedPreferences("PREFERENCE", MODE_PRIVATE).getBoolean("isFirstRun", true);
if (isFirstRun){
// Place your dialog code here to display the dialog
getSharedPreferences("PREFERENCE", MODE_PRIVATE)
.edit()
.putBoolean("isFirstRun", false)
.apply();
}
}