Activity crashes when remote service crashes

2019-07-28 07:01发布

问题:

I'm trying to understand remote services at the moment and everything works fine, i can start the service and know how to communicate with it through the AIDL-interface. My problem is that the service seems to still run in the same process like the activity it was started from, because the activity crashes too, if there is an error thrown in the Service.

I set the service process to remote ( android:process=":remote" ) so what am i doing wrong? Or what do i have to do to unbind the service-process completely from the activity-process?

回答1:

Post the code but if you are starting your service from your Activity, then they are running in the same process and you don't need to use AIDL. I posted an example of using a Service to do some Background work a few days ago.

Restful API service