I have a scenario in which the background service needs to pass data to activity after some interval. How to achieve it and what are the possible ways?
Asked
Active
Viewed 47 times
-2
-
Does this answer your question? [Bind service to activity in Android](https://stackoverflow.com/questions/1916253/bind-service-to-activity-in-android) – ardiien Oct 27 '20 at 12:45
1 Answers
0
There are different approaches to achieve what you need. The easiest is to use BroadcastReceiver. Register receiver from your activity and send broadcasts from service whenever you need. There are a lot of tutorials on Google on how to use BroadcastReceivers
.

0awawa0
- 328
- 2
- 5