mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 03:53:09 +08:00
CB-7976 Use webView's context rather than Activity's context for intent receiver
This commit is contained in:
parent
e78db000c6
commit
ac284fd39c
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user