mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
CB-7976 Use webView's context rather than Activity's context for intent receiver
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user