I have set up an RxAndroidBle Observable/Subscriber
to receive and log data from several Bluetooth LE peripherals. It is inside an Android Service
, which currently is of the Bound variety (to 2 different Activities).
I was planning to add the "Started Service" features to this Service
so it could continue to run when the Activities are suspended, but in early tests it looks like this isn't necessary: it seems to continue running when the App is in the background. I don't understand why this works, because the Android docs say that when all Activities unbind from a Bound Service
, it will be destroyed (both of my Activities call unbind()
in their onStop()
methods).
What's going on here? Is the existence of an active Observable
somehow keeping the Service
alive? What, if anything, should I do to manage this?