I have a Sony Xperia Compact running Android 8.0.0.
Recently I noticed that the WiFi constantly turns off and on. That is to say, I turn on WiFi, it searches for signal, shows a list of available networks and then turns off again by itself. It will then turn itself on again, and the cycle continues.
If I have airplane mode on, this sometimes allows me to hold a WiFi connection - but not always.
I am at a loss as how to approach this problem. I've tried resetting the network settings to default, which renders the same problem. I've tried running the phone in safe mode, to see if it was a 3rd party app, which also did not solve the problem.