我在我的应用程序中使用AIDL服务.
我也想运行它另一个进程,所以我在清单中的服务声明中使用android:process =“:remote”.
我的问题是,当:远程进程启动时,它显然重新创建了Application对象.
当我覆盖应用程序对象并在onCreate()方法中调用大量客户端东西时,我真的不这样做.但我希望服务代码与客户端驻留在同一个apk中.
我能做到吗?是否在新进程启动时始终重新创建Application对象?
感谢您的帮助.谢谢!
解决方法:
I also want to run it another process
为什么?为用户增加了什么价值,以抵消额外的RAM,CPU和电池成本?很少有应用需要多个流程.
My problem is that when the ‘:remote’ process starts it apparently recreates Application object
当然.每个过程都有自己的过程.
I really do not with that as I override application object and call lots of client stuff in the ‘onCreate()’ method
然后摆脱android:process =“:remote”.您的用户会感谢您.
Yet I want the service code to reside in the same apk with the client.
什么服务?
Is Application object always recreated when new process starts?
是.
标签:android,process,service
来源: https://codeday.me/bug/20190517/1122826.html