Hello Android Devs,

I've created a timer service (because I want the timer to accessible,
persistent, and run when the activity is not up), tested using a basic
front-end activity. The service and call backs all work fine, now what
I want to do is marry the service up to my timer view class. My timer
view class extends relativelayout. I have an activity which inflates
and adds the timer class to the view. What I'm trying to do is have
the class bind to the timer service and get updates via callbacks.

The problem I'm having is that bindService() is undefined, I think
this is because it's not part of the activity. If I pass the
constructor the activity context it does compile and run, however it
crashes every time. Plus, it's a bad idea to use context in this way.

The interface is 2-way, I send commands from the view to the service
and it sends timer and state updates back. I could use intents for
this, however that's clunky and wastes resources.

I could also have the activity itself bind to the service, but I'd
prefer to cut out the middleman.

How do I approach this problem?

-bb

-- 
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