Communicate with foreground service android

前端 未结 2 1537
耶瑟儿~
耶瑟儿~ 2021-02-04 01:15

First question here, but I\'ve been around for a while.

What do I have:

I\'m building an Android app which plays audio streams and online playl

2条回答
  •  借酒劲吻你
    2021-02-04 01:35

    Quoting Android documentation:

    A bound service is destroyed once all clients unbind, unless the service was also started

    And about the difference between started and bound just take a look to https://developer.android.com/guide/components/services.html

    So, you have to create the Service using startService and then bindService, like @Libin does in his/her example. Then, the service will run until you use stopService or stopSelf or until Android decides that it needs resources and kills you.

提交回复
热议问题