mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Fixing CB-1521 - NullPointerException on Default Jellybean Emulator
This commit is contained in:
parent
7eb12110d1
commit
2a9582ebb1
@ -99,7 +99,9 @@ public class NetworkManager extends Plugin {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));
|
||||
// (The null check is for the ARM Emulator, please use Intel Emulator for better results)
|
||||
if(webView != null)
|
||||
updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));
|
||||
}
|
||||
};
|
||||
cordova.getActivity().registerReceiver(this.receiver, intentFilter);
|
||||
@ -198,10 +200,9 @@ public class NetworkManager extends Plugin {
|
||||
result.setKeepCallback(true);
|
||||
this.success(result, this.connectionCallbackId);
|
||||
|
||||
// Send to all plugins
|
||||
webView.postMessage("networkconnection", type);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the type of connection
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user