I have been using Wifimanager.updateNetwork(wifiConfiguration);
in my app and it has been working on Kitkat, JellyBean & ICS, but now in Marshmallow it keeps returning -1 even when the wifiConfiguration is not null and has a valid networkId. Does anyone know the possible reasons for this ? Has something changed in Marshmallow regarding this ?
According to Android 6.0 Wi-Fi and Networking Changes,
Your apps can now change the state of WifiConfiguration objects only if you created these objects. You are not permitted to modify or delete WifiConfiguration objects created by the user or by other apps.