android进程回收

Caveats and ConsiderationsWhile we talked about process priorities in terms of components such as what activities and services you have, keep in mind that these priorities are done at the process level — not the component level. Just one component (say, a foreground service) will push the entire process into the foreground. While the vast majority of apps are a single process, if you have greatly varying lifecycles or an extremely heavyweight portion of your app that is independent of a long running lightweight portion, strongly consider making them separate processes to allow heavyweight processes to be collected sooner rather than later.Just as importantly though, what process category you fall into is based on what is happening at the component level. That means kicking off that super important long running operation in a separate thread from within your Activity might meet with disaster when you suddenly become a background process. Use the tools available to you (a Service or foreground Service based on priority) to ensure that the system is aware of what you’re doing.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值