开发者

How to gracefully terminate a remote service process?

Currently I believe I'm doing a ok job managing my applications remote service. When I'm done using it I can see the onDestroy() called, perfect...

Now the issue is I can see the remote process still hanging, via DDMS or via phone's running processes. Users see this and think I'm doing stuff on the background etc... blaming my app and than asking for an exit button... Truth is they don't need an exit button!

So my question:

How to gracefully terminate a remote service process?

I could get the PID and kill it but so开发者_运维问答mething tells me this might not be the nice way to do this since the service might be restarted again...

Any help would be greatly apreciated!

-Jona


Currently I believe I'm doing a ok job managing my applications remote service.

Simple solution: get rid of the remote service. If you wrote the app and the service, then you do not need it to be remote. The only time you need it to be remote is if the app and the service are part of two separate apps.

Now the issue is I can see the remote process still hanging, via DDMS or via phone's running processes.

Of course.

How to gracefully terminate a remote service process?

You don't. Android will terminate it if and when it chooses to. Hence, the simple solution is to get rid of the remote service process by not having a remote service in the first place.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜