我的应用正在连接到指定的wifi连接。连接后,我可以看到保存的应用。但是,当我关闭并关闭restart wifi
时,应用保存的信息丢失,因此我的应用无法删除该网络,因为marshmallow应用无法删除用户或其他设备创建的wifi连接应用。
如何在wifi重启或系统重启时保留myapp信息保存?
WifiConfiguration conf = new WifiConfiguration();
Log.d("SSID", networkSSID[0].toString());
Log.d("Pass", networkPass[0].toString());
conf.SSID = "\"" + networkSSID[0].toString() + "\"";
conf.preSharedKey = "\"" + networkPass[0].toString() + "\"";
int netId;
//reconnect = false;
netId = wifiManager.addNetwork(conf);
wifiManager.disconnect();
wifiManager.enableNetwork(netId, true);
wifiManager.reconnect();
在https://imgur.com/a/mqpH3之前 wifi重启后https://imgur.com/a/foxGV