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. c++之路起航——指针

    c++一阶指针 定义 存储类型名 数据类型 * 指针变量名: Eg:int *a://定义了一个指向整型的指针 a: 指针使用方法 int a,*b; b=&a;//表明将a的地址赋值给b: ...

  2. bzoj3304 [Shoi2005]带限制的最长公共子序列

    dp,时间复杂度O(n^3),f[i][j][k]表示a串到i,b串到j的时候,匹配了c串的k位,要用滚动数组 代码 #include<cstring> #include<algor ...

  3. 。。。HibernateTemplate与Session。。。

    今天在学习Spring框架的时候,突然发现了这个类----HibernateTemplate,这个类与Session一开始认为是差不多的,这个HibernateTemplate类对象拥有Session ...

  4. 手动写的第一个eChart代码

    手动写的第一个eChart代码 ,第一感觉,杂乱无章 <!doctype html> <html> <head> <meta charset="UT ...

  5. paper 89:视频图像去模糊常用处理方法

    随着“平安城市”的广泛建设,各大城市已经建有大量的视频监控系统,虽然监控系统己经广泛地存在于银行.商场.车站和交通路口等公共场所,但是在公安工作中,由于设备或者其他条件的限制,案情发生后的图像回放都存 ...

  6. Python快速建站系列-Part.One-组装开发环境

    |版权声明:本文为博主原创文章,未经博主允许不得转载. 源代码都在github上:SmallStudyStation 现在是个demo,但回来会租个服务器,等功能完善了放到服务器上挂着,域名jusot ...

  7. 转一篇 adaboost 的好文 AdaBoost简介及训练误差分析

    AdaBoost简介及训练误差分析 http://wenku.baidu.com/link?url=y9Q2qjrJr6IShyY5EQEmvkPZmmP4t3HOdHUgMWaIffI9W0uzTr ...

  8. [Ubuntu] Install teamviewer9 on Ubuntu14.04_x64

    The article copied from http://ubuntuhandbook.org/index.php/2013/12/install-teamviewer-ubuntu-1404/ ...

  9. [v]Debian类系统的有效国内源

    源文件的位置 /etc/apt/sources.list 因为测试需要,装完Debian7 后,更新为163的源,但是后来装软件时,一些软件依赖包还是装不上.后来把163源稍加改动,就好用了.163源 ...

  10. android SDK安装容易出错的原因

    1.实际上,安卓SDK安装之后,拷贝到其他的机子上面.配置一下环境变量,就可以跑起来的 2.但是拷贝到其他的机子上面临着一个问题就是Eclipse已经配置了的android环境,需要在新的机子上面修改 ...