Question

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();
    }
}

See the whole Class/Activity here(line 276):

https://github.com/voidcode/Diaspora-Webclient/blob/master/src/com/voidcode/diasporawebclient/MainActivity.java

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top