android:process application,使用android:process =“:remote”重新创建android应用程序对象...

我在我的应用程序中使用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值