Hello community, this is my first post here so im sorry if i made any
mistake.

I'm trying to use WifiManager to get the list of all available APs.
i'm using API 2.3.3 and i'm running the application on emulator.

i'm doing this code:

WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);

                        boolean isEnabled;
                        // 1.0
                        if(!wm.isWifiEnabled()){
                               //2.0
                                if(isEnabled=wm.setWifiEnabled(true))
                                {
                                        Log.i("Test","Is enabled: "+isEnabled);
                                }
                        }
                        //3.0
                        if(wm.isWifiEnabled()){
                                Log.i("Test","Enabled");
                        }

In 1.0 the wifi is disabled, so it enter the first if.
in 2.0 it makes it enabled and it enter the if Logging the "Is
enabled: true".
in 3.0 wifi is disabled, don't entering the if.

whats happening?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to