Pausing service until internet connection can be established
问题 I have a service that runs upon boot completion. This service requires internet connectivity. What's the best practice for waiting for the device to connect to the internet? Mobile of wifi doesn't really matter. My current solution involves a while loop that just checks ConnectivityManager until one of the networks becomes available, but this feels vulgar. Is there a better way to do this? 回答1: but this feels vulgar Indeed :D Your receiver wakes your wakeful intent service (probably a simple