I have a method call isNetworkAvailable()
to check if the user have enable wap/wifi/wimax this works for Android 2.1 to 2.3+.
But now a user of the app which uses honeycomb 3.2 on a Motorola xoom rapport to me that he can´t open the app.
In my android developer web-interface I can see this log-error: http://paste.ubuntu.com/811881/
private boolean isNetworkAvailable()
{
ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mobileInfo = connec.getNetworkInfo(0);
NetworkInfo wifiInfo = connec.getNetworkInfo(1);
NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
if (wimaxInfo!=null) {
return mobileInfo.isConnected() || wifiInfo.isConnected()|| wimaxInfo.isConnected();
}
else {
return mobileInfo.isConnected() || wifiInfo.isConnected();
}
}
mobileInfo or wifiInfo could be null. On a wifi-only device I wouldn't be surprised if mobileInfo (ConnectivityManager.TYPE_MOBILE) is null.