如何确定wifi连接是否成功

时间:2019-03-20 15:40:09

标签: android android-networking

如何知道重新连接功能是成功还是失败。 例如错误的密码

WifiConfiguration conf = new WifiConfiguration();
conf.SSID = "\"" + networkSSID + "\"";
conf.preSharedKey = "\"" + networkPassword + "\"";
int netId = wifiManager.addNetwork(conf);
wifiManager.disconnect();
wifiManager.enableNetwork(netId, true);
wifiManager.reconnect();

0 个答案:

没有答案