diff options
author | orionlee <orionlee@yahoo.com> | 2019-09-27 11:56:07 -0700 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-09-27 11:56:07 -0700 |
commit | 2fe70c3b41fb74e10d3b98b2d3ffbd3131d2708a (patch) | |
tree | 8f70c6515f9cd0712a6953f29457d85c5a3a36aa /app | |
parent | 0b5f4e9dc0b87d500a4139744883eb052e4815c7 (diff) | |
download | AntennaPod-2fe70c3b41fb74e10d3b98b2d3ffbd3131d2708a.zip |
Avoid Cast initialization UI - prompt users to restart upon settings changed.
Diffstat (limited to 'app')
-rw-r--r-- | app/src/play/java/de/danoeh/antennapod/preferences/PreferenceControllerFlavorHelper.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/src/play/java/de/danoeh/antennapod/preferences/PreferenceControllerFlavorHelper.java b/app/src/play/java/de/danoeh/antennapod/preferences/PreferenceControllerFlavorHelper.java index c9d52df0c..6db2ad7b0 100644 --- a/app/src/play/java/de/danoeh/antennapod/preferences/PreferenceControllerFlavorHelper.java +++ b/app/src/play/java/de/danoeh/antennapod/preferences/PreferenceControllerFlavorHelper.java @@ -1,8 +1,13 @@ package de.danoeh.antennapod.preferences; +import android.content.Context; +import android.support.annotation.NonNull; +import android.support.v7.app.AlertDialog; + import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; +import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.fragment.preferences.PlaybackPreferencesFragment; @@ -18,6 +23,7 @@ public class PreferenceControllerFlavorHelper { final int googlePlayServicesCheck = GoogleApiAvailability.getInstance() .isGooglePlayServicesAvailable(ui.getActivity()); if (googlePlayServicesCheck == ConnectionResult.SUCCESS) { + displayRestartRequiredDialog(ui.requireContext()); return true; } else { GoogleApiAvailability.getInstance() @@ -26,7 +32,16 @@ public class PreferenceControllerFlavorHelper { return false; } } + displayRestartRequiredDialog(ui.requireContext()); return true; }); } + + private static void displayRestartRequiredDialog(@NonNull Context context) { + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(android.R.string.dialog_alert_title); + dialog.setMessage(R.string.pref_restart_required); + dialog.setPositiveButton(android.R.string.ok, null); + dialog.show(); + } } |