Android BroadcastReceiver or simple callback method?

前端 未结 5 1417
情深已故
情深已故 2021-01-29 20:09

In my projects I am using BroadcastReceivers as a callback from a long running thread (eg. notify the activity that a download was finished and send some response d

5条回答
  •  一个人的身影
    2021-01-29 20:40

    I don't see what you gain by using BroadcastReceiver in your case. Callbacks or, better probably, Handlers would be the way to do it. BroadcastReceiver is good when you do not know who the subscribers are.

提交回复
热议问题