Why WifiConfiguration.BSSID is always null?

蓝咒 提交于 2021-01-21 06:38:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!