mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-16 08:21:04 +08:00
Fixing CB-1521 - NullPointerException on Default Jellybean Emulator
This commit is contained in:
parent
7eb12110d1
commit
2a9582ebb1
@ -99,6 +99,8 @@ public class NetworkManager extends Plugin {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
// (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));
|
updateConnectionInfo((NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -198,7 +200,6 @@ public class NetworkManager extends Plugin {
|
|||||||
result.setKeepCallback(true);
|
result.setKeepCallback(true);
|
||||||
this.success(result, this.connectionCallbackId);
|
this.success(result, this.connectionCallbackId);
|
||||||
|
|
||||||
// Send to all plugins
|
|
||||||
webView.postMessage("networkconnection", type);
|
webView.postMessage("networkconnection", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user