From ac284fd39c86c4fc7b83477ad960ef20892f5e8c Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 6 Nov 2014 16:23:32 -0500 Subject: [PATCH] CB-7976 Use webView's context rather than Activity's context for intent receiver --- framework/src/org/apache/cordova/App.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/App.java b/framework/src/org/apache/cordova/App.java index 160923ca..9e8c1fe0 100755 --- a/framework/src/org/apache/cordova/App.java +++ b/framework/src/org/apache/cordova/App.java @@ -287,7 +287,7 @@ public class App extends CordovaPlugin { }; // Register the receiver - this.cordova.getActivity().registerReceiver(this.telephonyReceiver, intentFilter); + webView.getContext().registerReceiver(this.telephonyReceiver, intentFilter); } /* @@ -296,6 +296,6 @@ public class App extends CordovaPlugin { */ public void onDestroy() { - this.cordova.getActivity().unregisterReceiver(this.telephonyReceiver); + webView.getContext().unregisterReceiver(this.telephonyReceiver); } }