可以杀死的android前景活动? [英] can android kill a foreground activity?

查看:194
本文介绍了可以杀死的android前景活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Android SO,如果它需要的内存可以杀死的活动和过程。

I know that android SO can kill activities and process if it needs memory.

问题1:
的android能如果是在前台杀死一个活动?

Question 1: Can android kill an activity if it is in foreground?

问题2:
的android能如果活动是在前台杀死活动的过程吗?

Question 2: Can android kill the activity's process if the activity is in foreground?

推荐答案

而Android的流程和应用程序生命周期文件指出:

The Android processes and application lifecycle document states that:

前台进程

...

有仅会在系统中的几个这样的过程,且这些
  只会被杀死作为最后的手段,如果内存是如此之低,甚至没有
  这些过程可以继续运行。通常,在这一点上,
  装置已经达到了一个存储器寻呼状态,所以需要此操作
  为了保持用户界面的响应。

There will only ever be a few such processes in the system, and these will only be killed as a last resort if memory is so low that not even these processes can continue to run. Generally, at this point, the device has reached a memory paging state, so this action is required in order to keep the user interface responsive.

这意味着你的活动(因此过程)可以被杀死,但只有在极端的内存条件,作为最后的手段。空的过程中,后台进程,服务流程和可见的过程都将被杀死之前,你的进程将被杀死所以它的极其不太可能,这将不会发生,但可能性是存在的,如果让你的应用程序中打开会导致系统不稳定。

Which means your activity (and therefore process) can be killed but only under extreme memory conditions and as a last resort. Empty processes, background processes, service processes and visible processes will all be killed before your process will be killed so it's extremely unlikely this will ever happen but the possibility is there if leaving your application open will lead to system instability.

这篇关于可以杀死的android前景活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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