Intent和PendingIntent的区别
来源:互联网 发布:mac怎么用word文档 编辑:程序博客网 时间:2024/06/14 01:17
Intent和PendingIntent的区别
intent英文意思是意图,pending表示即将发生或来临的事情。
PendingIntent这个类用于处理即将发生的事情。比如在通知Notification中用于跳转页面,但不是马上跳转。
Intent 是及时启动,intent 随所在的activity 消失而消失。
PendingIntent 可以看作是对intent的包装,通常通过getActivity,getBroadcast ,getService来得到pendingintent的实例,当前activity并不能马上启动它所包含的intent,而是在外部执行 pendingintent时,调用intent的。正由于pendingintent中 保存有当前App的Context,使它赋予外部App一种能力,使得外部App可以如同当前App一样的执行pendingintent里的 Intent, 就算在执行时当前App已经不存在了,也能通过存在pendingintent里的Context照样执行Intent。另外还可以处理intent执行后的操作。常和alermanger 和notificationmanager一起使用。
Intent一般是用作Activity、Sercvice、BroadcastReceiver之间传递数据,而Pendingintent,一般用在 Notification上,可以理解为延迟执行的intent,PendingIntent是对Intent一个包装。
- Intent和PendingIntent的区别
- PendingIntent和Intent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- PendingIntent和Intent的区别
- PendingIntent和Intent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- PendingIntent和Intent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- Intent和PendingIntent的区别
- DB2迁移(db2look+db2move)
- 约瑟夫问题(c++)
- python语法图解
- 如何使用CCRenderTexture创建动态纹理
- SSH命令详解
- Intent和PendingIntent的区别
- 工作队列
- Android 匿名共享内存C++接口分析
- xcode unused variable 'alert'
- ios的手势操作之UIGestureRecognizer浅析
- 人生大智慧经典总结
- Java线程(八):Condition-线程通信更高效的方式
- oracle静默安装文件db_install.rsp详解
- 当访问php遇到空白页时