问题
It's becoming increasingly frustrating trying to get NetworkInfo working. I posted a question, but I guess people haven't seen it. Anyway, I really need a solution based on my flow below. I need to know when my network changes so I can determine what kind of network it is and then make decisions based off that answer. I thought, OK, maybe I'll try JobService, but I am not having a lot of luck trying to puzzle out how to use it for my needs. My app is reactive and happens all behind the scenes and only shows a notification when the user needs to do something. So, I guess I'm looking for direction. How to use JobService to get the granular information I need * and * to use to replace BroadcastReceiver for both Network Changes and Alarms. I'll need to be able to cancel/modify alarms as IPs change while people roam around.
来源:https://stackoverflow.com/questions/42739403/using-jobservice-to-replace-broadcastreceiver-network-changes-and-alarms