Why does my samsung s4's wifi turn its self off constantly?

A

AC Question

I'm sure it isn't my router because all other devices connect fine and it isn't an issue of connection the connection works flawlessly when the wifi is on, it's an issue of the phones wifi actually staying on, if you sit in the settings screen you can literally see the little switch just turn its self off. It will stay on for roughly 10-15 seconds before i have to either manually turn it back on or it turns its self back on and runs smoothly... for 10 seconds. The funny thing is it sometimes decides to stay on for 30-60 minutes or whenever i download a software update the connection stays on for the duration of the download and then goes back to its old ways after the update is complete. I've tried a factory reset which worked for, maybe, 3 days... then back to the old ways. It's incredibly frustrating, please help. Thanks.