问题
I'm reading existing Wi Fi configuration. Code is pretty decent
WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
List<WifiConfiguration> configurations= null;
if (wifiMgr != null)
{
configurations = wifiMgr.getConfiguredNetworks();
}
I have necessary permissions:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
The problem is- all (at least in my case) BSSIDs in the WifiConfiguration is NULL, despite the fact that BSSID (MAC) can be seen in the Settings. What could be the problem and how to fix it?
Alternative question- where to get code for Setting's Wifi Settings (Gingerbread), as it does show BSSIDs
来源:https://stackoverflow.com/questions/8863059/why-wificonfiguration-bssid-is-always-null