I'm using a Galaxy Ace. When I turn off WiFi and try to turn it on again it shows an error. I need to restart my device for it to work. Any ideas?
I believe this is a problem with Samsung's UI, TouchWiz; I experienced this on a couple ROMs for my Galaxy S.
I don't know of any way to fix it without replacing your ROM, but I did find that going to
Settings -> Wireless and network -> WiFi settings and toggling WiFi there seemed to work. Settings is a standard Android OS app and thus bypasses whatever problem TouchWiz has when you try to toggle the WiFi from the notification area.
I did have a problem a few months ago where I'd keep getting an error when I tried to turn Wifi on, which needed a reboot of the phone to fix.
I traced it back to an app that I'd installed recently, the app in question monitored the wifi connections and did funny things ensuring you connected to specified wifi points when they were available. After I uninstalled the app the problem went away (the app in question was the BT FON app, in case you have the same one).
So it's probably worth thinking about when the problem first started, and then working out which apps that have anything to do with wifi you may have installed or updated around that time, and removing those apps for a few days to see if it helps.