为什么"在onPause"不叫在下列情况下? [英] why "onPause" is not called in following situation?

查看:138
本文介绍了为什么"在onPause"不叫在下列情况下?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由文档,在onPause之称,当:

By the document, "onPause" is called, when:

当系统即将启动恢复一个previous活动。

when the system is about to start resuming a previous activity.

相比的onStop,所不同的是:

Compared to "onStop", the difference is:

在活动不再对用户可见的,因为其他活动已经恢复并且覆盖这个叫。

Called when the activity is no longer visible to the user, because another activity has been resumed and is covering this one.

但是,当我长preSS HW-Home键和最近的应用程序显示了, 该的onPause不叫。

But when I long-press HW-Home key and the "recent apps" shows up, the "onPause" is not called.

在这个时刻,我不能长时间能够与原来的活动互动, 但它仍然是可见的。

At this moment, I can no long able to interact with the original activity, but it is still visible.

我对这种情况感到困惑。 请帮忙解释一下。

I am confused by this situation. Please help to explain.

非常感谢你。 BR, 亨利

Thank you very much. BR, Henry

推荐答案

这其实是因为当Home键长pressed,没有活动正在展开。该的onPause /的onStop将只有当你选择的应用程序present在最近的应用程序列表中的一个被调用。

This actually happens because when the Home key is long pressed, there is no activity being launched. The onPause/onStop will only be called if you select one of the apps present in the "Recent Apps" list.

在onPause的文档()是pretty的明确的:

The docs of onPause() are pretty clear:

古称活动周期的一部分,当活动是怎么回事   到背景中,但还没有(还)被杀害。

Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed.

这篇关于为什么"在onPause"不叫在下列情况下?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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