Hi, I am working on an App that uses the WifiManager to register new wifis and to establish connections to those.
Setting up a correct WifiConfiguration Object is discussed in depth and I followed the instructions. Though I ran into some strange behaviour that i'd like to discuss. When I call: ------------- wifiManager.enableNetwork(w.networkId, true); ------------- It does not connect to the network and if I change into the system settings I see that the wifi state is "failed". Then if I configure the wifi inside the system settings it connects without a problem. I searched the web for hours tried any possible FLAG on the WifiConfiguration Object but it didn't effect the result. Then I looked into the reference of WifiManager again and found that method ------------- wifiManager.reassociate(); ------------- Turned out, that this is just what makes the magic happen. Calling reassociate after enableNetwork just made it happen, it connected. I think this is not how the API is designed and should be used. But it works for me so I am happy. Since I am using a rooted G1 with a custom ROM it maybe also be a problem of that specific ROM. Is there anyone who had the same headache? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.