开发者

Can a service get a reference to the activity during onBind?

I have a service that basically manages a MediaPlayer i开发者_Go百科nstance for playing podcasts. Once an activity binds to the service it can do things like play, pause, stop, etc. I used a service because I want the podcast to continue playing even after the activity is destroyed.

I'd like the service to be able to send messages back to the activity in case of an error or for normal status updates. Is it possible for the service to get a reference to the activity that's trying to bind to it? Doesn't look like the intent makes this available.


The SDK samples API Demos app has an example of a service that messages back to an activity

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜