BroadcastReceiver vs Service

前端 未结 2 2077
鱼传尺愫
鱼传尺愫 2020-12-09 05:33

Well, in android, what is the difference between doing something in broadcastReceiver and calling another service in broadcastReceiver? I t

2条回答
  •  感情败类
    2020-12-09 05:42

    You should do as LITTLE processing in a BroadcastReceiver as possible because (quoting from the Android Blog)

    When handling a broadcast, the application is given a fixed set of time (currently 10 seconds) in which to do its work. If it doesn't complete in that time, the application is considered to be misbehaving, and its process immediately tossed into the background state to be killed for memory if needed.

提交回复
热议问题