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的执行等。

  • 相关阅读:
    QPS的优化
    面试题
    py-redis
    集群化的部署
    RESTful设计
    python第三方库------jieba库(中文分词)
    csv文件读写处理
    python中的turtle库(图形绘画库)
    html中form表单的使用方法和介绍
    WC2019
  • 原文地址:https://www.cnblogs.com/leizz/p/11250793.html
Copyright © 2011-2022 走看看