WifiManager.getConfiguredNetworks always returns empty list

后端 未结 3 748
暖寄归人
暖寄归人 2021-01-23 14:51

I am trying to connect to an open wifi network. When I open my app it should turn on wifi and connect to the network defined as below. The problem is that WifiManager.getC

3条回答
  •  耶瑟儿~
    2021-01-23 15:37

    I also met this question unfortunely.

    After searching for some time, I think it is a bug.

    This is the android implement of getConfiguredNetworks

    public List getConfiguredNetworks() {
        try {
            return mService.getConfiguredNetworks();
        } catch (RemoteException e) {
            return null;
        }
    }
    

    It is clearly shown that the function will return null if RemoteException happened when running. Up to now, I am also distressed with this and could not get some points to address this issue.

    For more information: https://code.google.com/p/android/issues/detail?id=19078

提交回复
热议问题