Using JobService to replace BroadcastReceiver? Network changes and alarms

霸气de小男生 提交于 2019-12-08 04:01:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!