活动崩溃时,远程服务崩溃 [英] Activity crashes when remote service crashes

查看:107
本文介绍了活动崩溃时,远程服务崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解目前远程服务,一切工作正常,我可以启动该服务,并知道如何使用它通过AIDL接口通信。我的问题是,该服务似乎仍处于就像是从开始在活动同一进程中运行,因为活动崩溃也一样,如果有一个在服务引发的错误

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?

推荐答案

发表了code,但如果你开始从你的活动你的服务,那么他们在同一个进程中运行,你不需要使用AIDL。我贴出使用服务做一些后台工作,前几天的一个例子。

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.

<一个href=\"http://stackoverflow.com/questions/3197335/3197456#3197456\">http://stackoverflow.com/questions/3197335/3197456#3197456

这篇关于活动崩溃时,远程服务崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆