Intents

  An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways, there are three fundamental use-cases:

 Intent用来封装各组件跳转时的数据,行为,目标组件等信息的类。通常有下面3个功能:
  • To start an activity:

  An Activity represents a single screen in an app. You can start a new instance of an Activity by passing an Intent to startActivity(). The Intent describes the activity to start and carries any necessary data.

  If you want to receive a result from the activity when it finishes, call startActivityForResult(). Your activity receives the result as a separate Intent object in your activity's onActivityResult() callback. For more information, see the Activities guide.

  • To start a service: 

A Service is a component that performs operations in the background without a user interface. You can start a service to perform a one-time operation (such as download a file) by passing an Intent to startService(). The Intent describes the service to start and carries any necessary data.

If the service is designed with a client-server interface, you can bind to the service from another component by passing an Intent to bindService(). For more information, see the Services guide.

  • To deliver a broadcast: 

  A broadcast is a message that any app can receive. The system delivers various broadcasts for system events, such as when the system boots up or the device starts charging. You can deliver a broadcast to other apps by passing an Intent to sendBroadcast(), sendOrderedBroadcast(), or sendStickyBroadcast().

  注意:没有ContentProvider

Intent官方教程(1)简介和作用的更多相关文章

  1. Intent官方教程(5)在manifest中给组件添加<Intent-filter>

    Receiving an Implicit Intent To advertise which implicit intents your app can receive, declare one o ...

  2. Intent官方教程(4)用Intent构造应用选择框

    Forcing an app chooser When there is more than one app that responds to your implicit intent, the us ...

  3. Intent官方教程(3)各属性介绍

    Building an Intent An Intent object carries information that the Android system uses to determine wh ...

  4. Intent官方教程(2)Intent的两种类型

    Intent Types There are two types of intents: Explicit intents specify the component to start by name ...

  5. ContentProvider官方教程(2)简介、Content URIs

    In this document Overview Accessing a provider Content URIs Content Provider Basics A content provid ...

  6. Intent官方教程(6)常见Intent示例,启动日历,时钟,镜头等。

    guide/components/intents-common.html 包含:Alarm Clock Calendar Camera Contacts/People App Email File S ...

  7. Layout Resource官方教程(1)简介

    Layout Resource SEE ALSO Layouts A layout resource defines the architecture for the UI in an Activit ...

  8. ActionBar官方教程(1)简介及各区域介绍

    Action Bar The action bar is a window feature that identifies the user location, and provides user a ...

  9. SwiftUI 官方教程

    SwiftUI 官方教程 完整中文教程及代码请查看 https://github.com/WillieWangWei/SwiftUI-Tutorials   SwiftUI 官方教程 SwiftUI ...

随机推荐

  1. HDU 1728 逃离迷宫(BFS)

    Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有 ...

  2. 转 SSIS处理导入数据时, 存在的更新, 不存在的插入

    SSIS处理导入数据时, 存在的更新, 不存在的插入 分类: DTS/SSIS2006-09-10 12:43 18185人阅读 评论(22) 收藏 举报 ssissql servermicrosof ...

  3. sql 去除列中内容的单引号

    update  [dbo].[历史数据补全$]  set  bankCardNo=replace(bankCardNo,'''','') 总共4个单引号,外边2个是字符串固有的2个,里边两个就表示是一 ...

  4. mybatis的xml中特殊转义字符和模糊查询like的写法

    做个备忘: xml特殊符号转义写法 <          < >          > <>   <> &      & &ap ...

  5. Verilog篇(一)

    Verilog在行为级建模时常用到的一些函数,变量等. 1:$random(seed),每次根据seed的值产生一个32位的有符号数,seed的数据类型必须是寄存器(reg),整形(integer), ...

  6. python 笔记1

    Python join()方法 描述 Python join() 方法用于将序列中的元素以指定的字符连接生成一个新的字符串. 语法 join()方法语法: str.join(sequence) 参数 ...

  7. c 语言 结构体

    一:结构体定义结构体类型变量 三种方式1st:先声明结构体类型,再定义该类型的变量struct student liming,zhangle;2nd:声明类型的同时定义变量struct student ...

  8. 解决filezilla中无法显示中文的文件名

    设定字符集时选择自定义字符集, 然后输入字符集为 GBK

  9. java类的访问权限

    1.解析 Java有四种访问权限, 其中三种有访问权限修饰符,分别为private,public和protected,还有一种不带任何修饰符. private: Java语言中对访问权限限制的最窄的修 ...

  10. 由于 add 运算符中“Chinese_PRC_CI_AS”和“Chinese_PRC_CS_AS_WS”之间的排序规则冲突

    有一个字段的排序规则是 Chinese_PRC_CS_AS_WS,字符串连接的时候报错. 处理方案 cast(columnName as varbinary) 即可