Intent和PendingIntent的区别
来源:互联网 发布:廖雪峰javascript pdf 编辑:程序博客网 时间:2024/04/30 17:21
比如你想启动一个Activity,就会通过 Intent来描述启动这个Activity的某些特点,让系统找到这个Activity来启动,而不是启动别的Activity.StartActivity(intent)就会立即启动这个Activity.而PendingIntent呢?Penging中文意思就是:待定,将来发生或来临.PendingIntent的就的意思就是不是像Intent那样立即发生,而是在合适的时候才会去触发对应的 Intent.
PendingIntent可以看作是对Intent的包装。供当前App之外的其他App调用。有点“被动”或是“Callback”的意思,但不是严格意义上的“被动”或是“Callback”。总之,当前App不能用它马上启动它所包裹的Intent。而是在外部App执行这个 PendingIntent时,间接地、实际地调用里面的Intent。PendingIntent主要持有的信息是它所包装的Intent和当前App 的Context。正由于PendingIntent中保存有当前App的Context,使它赋予外部App一种能力,使得外部App可以如同当前 App一样的执行PendingIntent里的Intent,就算在执行时当前App已经不存在了,也能通过存在PendingIntent里的 Context照样执行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的区别
- 隐式Intent
- struts 1.3 核心组件(三)
- 7.鼠标移到GridView某一行时改变该行的背景色方法二:
- : ubuntu中Samba服务之配置
- 2012.09.05
- Intent和PendingIntent的区别
- 8.GridView实现删除时弹出确认对话框:
- [转]老年人吃炖得熟透了的肥肉可以降血脂、降血压、降胆固醇
- 新鲜出炉的30个精美的 jQuery & CSS3 效果【附演示和教程】
- ADF11g-012:使用 ADF Skin
- 9.GridView实现自动编号:
- 堆与栈的区别
- 应用程序无法正常启动(Oxc0150002),xp程序向win7下的移植
- crontab与环境变量