Hi all..
I am trying to make the interaction with a background service work. As I 
think it often happens, I need to call some method of the service from my 
main activity, and I need to be notified about some state changes from my 
service.

What I have done is to bind the background service from the activity, and to 
pass it a callback interface to be called from the service. Now my question: 
let's suppose that the callback updates some view (ie a textview) with the 
state of the service. What should I do when the activity gets paused? Should 
I unregister the interface (and check if the interface to be called is not 
null in the service), like a basic observer pattern? And again: what would 
happen if I do not unregister the interface, and the service tries to update 
some gui element while the activity is not visible?

I know this would be solved using the intents - broadcast receiver to notify 
the activity, but in my case the output given from the service is supposed 
to vary often, and I feel binding the service is a more suitable option in 
my case.

Hope I was clear enough,

Thanks a lot in advance

   Federico

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to