如何我们可以在任何活动中使用onNewIntent()? [英] How we can use onNewIntent() in any Activity?

查看:87
本文介绍了如何我们可以在任何活动中使用onNewIntent()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是真正的使用 onNewIntent()的活动的生命周期,我们如何使用这种方法吗?

What is the real use of onNewIntent() in the activity life cycle and how do we use this method?

推荐答案

这称为该设置launchMode为singleTop在他们的包,或活动如果客户端调用startActivity(意向)时所使用的FLAG_ACTIVITY_SINGLE_TOP标志。

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

如果您设置为单个顶部,活动将不被如果这是在历史堆栈顶部已经运行启动。它不会重新启动刚刚从堆栈中显示。

If you set to single top, the activity will not be launched if it is already running at the top of the history stack. It will not relaunch just show from stack.

这篇关于如何我们可以在任何活动中使用onNewIntent()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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