Question: Sometimes after I shut off Wi-Fi using the button inside the notification bar drop-down, I can't turn it back on with that button. Hitting the button does nothing, it's not even highlighted. When I go into `Settings -> Wireless and network -> Wi-Fi settings` the status under "Wi-Fi" shows Error. If I click "Wi-Fi" to turn it on from here, it usually turns on without any problems. Occassionally I have to reboot to fix it.

Is there a fix I can use to make the TouchWiz Wi-Fi button work the same as enabling/disabling the Wi-Fi in Settings? Or, ideally, is there some way I can prevent the Wi-Fi from getting into an error state when I turn it off and back on?

I have a Galaxy S Vibrant running 2.2, but this has been reported on other Samsung phones as well ([example](https://android.stackexchange.com/questions/12233/wifi-error-when-turning-on-closed)).

Answer: 
I've had the same thing happen to me on my LG G2X running CyanogenMod. So I don't think it's related to your specific device or software. Moderate success has been reported using the "[FXR WiFi Fix And Rescue](https://market.android.com/details?id=com.brilliapps.wifiandmorefixer&hl=en)" app, and it's been tested on the Vibrant. You can also try [WiFi Fixer](https://market.android.com/details?id=org.wahtod.wififixer).
I finally found an easy workaround that does NOT require me to restart my phone.
(After one year of getting annoyed with this Wi-Fi "error" message on a crappy Samsung GT-I5500, running android 2.2)

1. In the Wi-Fi settings screen (where you toggle Wi-Fi on/off), tap your phone's `Menu` button to open a context menu at the bottom of the screen.
2. Click '*Advanced*'
3. Switch the Wi-Fi sleep policy from '*When screen turns off*' to '*Never*'. (I think switching it from *any* setting to *any other* will actually work)

I've been trying this out for a couple of weeks, and turning on the Wi-Fi after doing the above has so far always worked. I've also changed to setting back to 'When screen turns off'. Perhaps leaving it a 'never' will prevent the error from turning up, but I'd like the sleep policy to save some battery.