When getting a WifiManager System Service like this
WifiManager mainWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
I have the following permissions in the Manifest file:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Eclipse LogCat logs an error
"mWifiServiceMessenger == null" [Tag: WifiManager]
Everything seems to work fine nevertheless. I do get an instance of WifiManager back. But the error is logged, also regardless of the Wifi state (enabled or disabled.
I would like to understand why this error is logged and what it does imply.
This error occurs when the device has the WiFi turned off. If the device can't get the WIFI_SERVICE.
Anyway not all the devices throw this error.
In your case it is posible that you're trying to get the WiFi service and if not you're using the cellular data.
It is thrown by WifiManager:
E/WifiManager: mWifiServiceMessenger == null
I had the same problem and I found the solution. You have to add CHANGE_WIFI_STATE
permission in your manifest.
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With