Android onNewIntent
来源:互联网 发布:hishop云商城2.0源码 编辑:程序博客网 时间:2024/05/01 18:15
protected void onNewIntent(Intent intent)
Added in API level 1
This is called for activities that set launchMode to "singleTop" in their package, or if a client used theFLAG_ACTIVITY_SINGLE_TOP
flag when callingstartActivity(Intent)
. In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it.
An activity will always be paused before receiving a new intent, so you can count ononResume()
being called after this method.
Note that getIntent()
still returns the original Intent. You can usesetIntent(Intent)
to update it to this new Intent.
Parameters
See Also
getIntent()
setIntent(Intent)
onResume()
调用 onNewIntent 有两种情况:
第一种: 这个 Activity A设置为 SingleTop 启动模式。也就是位于栈顶就不新创建。
第二种: 启动一个 Activity A时把 Intent flag 设置为
FLAG_ACTIVITY_SINGLE_TOP 。
如果重新启动这个 Activity A,当 A 位于栈顶时(这样 A 不用新建实例),onNewIntent 将会被调用。
另外,如果有必要更新获取的 Intent,需要调用下 setIntent。这个方法一般也是和 onNewIntent 连用的。
0 0
- android onNewIntent
- android onNewIntent
- android onNewIntent
- android onNewIntent
- android onNewIntent
- Android onNewIntent
- android onNewIntent
- android onNewIntent
- android onNewIntent
- android onNewIntent
- Android onNewIntent
- android onNewIntent
- android--onNewIntent
- android onNewIntent
- android onNewIntent()
- android onNewIntent
- Android onNewIntent的应用
- Android onNewIntent的应用
- JSONObject与JSONArray的使用
- <%@ include file="relativeURL" %>静态及<jsp:include>动态
- linux下C连接mysql示例
- C语言IP有效性检查
- 查询Oracle的一些相关信息
- Android onNewIntent
- 怎样提高程序效率
- android 打包 /${zipalign}" error=2, No such file or directory
- Solr学习总结-Facet
- Oracle不等值链接
- 定时弹出层
- 编程题目:PAT 1005. 继续(3n+1)猜想 (25)
- poj 3294 ( 后缀数组 不小于 k 个字符串中的最长子串 )
- 重载和重写的区别