diff --git a/src/android/com/adobe/phonegap/push/PushPlugin.java b/src/android/com/adobe/phonegap/push/PushPlugin.java index c1f0a10c6..8bec730d5 100644 --- a/src/android/com/adobe/phonegap/push/PushPlugin.java +++ b/src/android/com/adobe/phonegap/push/PushPlugin.java @@ -510,12 +510,6 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) { public void onPause(boolean multitasking) { super.onPause(multitasking); gForeground = false; - - SharedPreferences prefs = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, - Context.MODE_PRIVATE); - if (prefs.getBoolean(CLEAR_NOTIFICATIONS, true)) { - clearAllNotifications(); - } } @Override @@ -529,6 +523,12 @@ public void onDestroy() { super.onDestroy(); gForeground = false; gWebView = null; + + SharedPreferences prefs = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, + Context.MODE_PRIVATE); + if (prefs.getBoolean(CLEAR_NOTIFICATIONS, true)) { + clearAllNotifications(); + } } private void clearAllNotifications() {