I want to schedulers background service to run a scan method. so the service will update the number of scanned file. how can i handle the case that i closed the app schedulers run the service, the update ui method will crash and stop running the service.
Asked
Active
Viewed 9,361 times
2 Answers
3
According to my case
I changed the structure to let the service to send a broadcast and receive it in the activity.

Basbous
- 3,927
- 4
- 34
- 62
-
3How often u send data from service to activity? How this influence performance if u send it let's say 10x per second? 10q – Ewoks Feb 12 '13 at 09:20
1
See this link. Its a very good example of Service
. It illustrates both way communication.
-
i change the structure to let the service to send a broadcast and receive it in the activity – Basbous May 12 '12 at 16:15
-
you really don't need to send a broadcast from service to transfer data. There is `ServiceConnection` and `Messenger`class to help you do that specific job. But thats ok if it works! :) – jamael May 13 '12 at 09:56
-