I have an Android Service which copies files to an ftp server.
While it is doing that, I want to send feedback to my Activity so the user knows what happens.
I tried implementing it using the RemoteMessengerServiceSample code, but I have a problem ... All messages I send during the ftp transfer 开发者_运维技巧arrive at my Activity the moment the copy operation is finished ... not message by message while the copy job runs as I would like.
Is there any way to fix this? Maybe i'm using the wrong method for sending messages to my activity?
Try issuing a Broadcast it's much more simpler than implementing the service<-->activity binding.
This will help you for the activity side how can I notify a running activity from a broadcast receiver?
精彩评论