Someday I turn on WiFi like usual as my daily activity but I don't know it's just turning grey and then switch back to off. Do you have same problem? Here what I do to solve it.
Method 1 : Power Cycle
This is the first step you have to do when you can't turn on your WiFi or Hotspot tethering on your phone. Just pull out the battery and wait for 1 minutes or more to reset the power cycle of your phone. If your device has removable battery so you need to press power button longer to force shutdown. Put your battery back and try again to turn on the WiFi. Still has no luck? Goes to method 2.
Method 2 : WPA_Supplicant fix
You need to root your device to apply this trick. Find it on internet how to root it. All you have to do is just deleting wpa_supplicant.conf file and while you've got restarted your phone system will make another new one. Find this files stored on your device. Most common android device will located on /data/misc/wifi/wpa_supplicant.conf
Method 3 : Reset Factory
Problem still? Now you need to backup all of your data and do factory reset. Goes to recovery on your device (find it how cause every phone has different ways to boot recovery). Then reset or wipe to factory reset. Be careful this way will delete all of your files inside so take a backup before doing this.
Method 4 : Flash Firmware
This is the last trick to do if you have done every ways above but still no luck. Flash your device to factory firmware or upgrade your Android version if your vendor release the new one.
If every trick has done but you still have the problem, now is time to check the hardware issues.
Method 1 : Antenna connectivity
There is many possibilities related to WiFi problem. First I have done is check the antenna, some device has antenna mounted to the back case or mid case. If you have phone more than 2 year maybe it's time to open the case and go to clean up. Pull the antenna cable then plug it back. Then reboot and see if it works.
Method 2 : WiFi chips module
If you are an expert in electronic repairing so you can try to re-hot the Wifi chip using blower hot air or just go to local phone repair shop to do this. But for easiest way just replace the whole mainboard of your device that you can found it on e-Bay.