how to send message from service to activity

不想你离开。 提交于 2019-12-05 04:48:31

One way is using ResultReceiver. Here is my complete blog post which I had recently posted with an Example.

How to update Activity from Service using ResultReceiver

For sending a message or any data from service to Activity you will need to Register an Custom Broadcast receiver.see these tutorials for sending data from service to Activity:

Communication between service and activity – Part 1

Custom Intents and Broadcasting with Receivers

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