zoukankan      html  css  js  c++  java
  • android pendingIntent的理解

    一、pendingIntent的字面意义:等待的,未决定的Intent。intent:意图,pending:即将发生或将要来临的事情。

      1.pendingIntent对象,使用的静态方法:

        getActivity(Content ,int ,Intent,int)跳转到一个Activity组件。
        getBroadcast(Content ,int ,Intent,int)打开一个广播组件。
        getService(Content,int Intent,int)打开一个服务组件

      2.pending是一个特殊的Intent,主要区别:Intent是立即执行,pending不是立刻执行的。pending执行的操作实质上是参数Intent的参数,但是执行需要满足一定的条件。
        Pending是对Intent的一个包装,使用PendingIntent时,在外部App执行调用Intent的,在pendingIntent中,保存着当前App的Content,就算当前执行的App已经不存在了,也能通过pending中的content执行Intent。还可以处理Intent处理后的操作。

    二、主要用途:通知Notification的发送,短消息SmsManager的发送,警报器AlarmManager的执行等。

  • 相关阅读:
    超链接导航栏案例
    css中定位功能的特性
    background的使用
    数据库单表查询
    各种算法
    面向对象能做什么和特性及嵌套
    c3算法详解
    面向对象继承
    生成器
    迭代器
  • 原文地址:https://www.cnblogs.com/leizz/p/11250793.html
Copyright © 2011-2022 走看看