From 4976d53e6a87d1bf189ef09cb2c4adc03fb015b8 Mon Sep 17 00:00:00 2001 From: darryncampbell Date: Mon, 17 Apr 2017 08:28:20 +0100 Subject: [PATCH] Big fix if try to unregister a receiver twice --- src/android/IntentShim.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/android/IntentShim.java b/src/android/IntentShim.java index 967109a..77daccf 100644 --- a/src/android/IntentShim.java +++ b/src/android/IntentShim.java @@ -152,7 +152,11 @@ else if (action.equals("sendBroadcast")) } else if (action.equals("unregisterBroadcastReceiver")) { - ((CordovaActivity)this.cordova.getActivity()).unregisterReceiver(myBroadcastReceiver); + try + { + ((CordovaActivity)this.cordova.getActivity()).unregisterReceiver(myBroadcastReceiver); + } + catch (IllegalArgumentException e) {} } else if (action.equals("onIntent")) {