Intent官方教程(1)简介和作用
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)简介和作用的更多相关文章
- Intent官方教程(5)在manifest中给组件添加<Intent-filter>
Receiving an Implicit Intent To advertise which implicit intents your app can receive, declare one o ...
- Intent官方教程(4)用Intent构造应用选择框
Forcing an app chooser When there is more than one app that responds to your implicit intent, the us ...
- Intent官方教程(3)各属性介绍
Building an Intent An Intent object carries information that the Android system uses to determine wh ...
- Intent官方教程(2)Intent的两种类型
Intent Types There are two types of intents: Explicit intents specify the component to start by name ...
- ContentProvider官方教程(2)简介、Content URIs
In this document Overview Accessing a provider Content URIs Content Provider Basics A content provid ...
- Intent官方教程(6)常见Intent示例,启动日历,时钟,镜头等。
guide/components/intents-common.html 包含:Alarm Clock Calendar Camera Contacts/People App Email File S ...
- Layout Resource官方教程(1)简介
Layout Resource SEE ALSO Layouts A layout resource defines the architecture for the UI in an Activit ...
- ActionBar官方教程(1)简介及各区域介绍
Action Bar The action bar is a window feature that identifies the user location, and provides user a ...
- SwiftUI 官方教程
SwiftUI 官方教程 完整中文教程及代码请查看 https://github.com/WillieWangWei/SwiftUI-Tutorials SwiftUI 官方教程 SwiftUI ...
随机推荐
- Android Handler练习
package com.example.myact12; import java.util.Random; import android.support.v7.app.ActionBarActivit ...
- Mysql索引总结(一)
数据库开发中索引的使用占了很重要的位置,好的索引会使数据库的读写效率加倍,烂的索引则会拖累整个系统甚至引发灾难. 索引分三类: index ----普通的索引,数据可以重复 unique ----唯一 ...
- 夺命雷公狗---DEDECMS----6快速入门之总结篇
我们dedecms四大表分别是: dede_channeltype(模型表) dede_arctype(栏目表) dede_archives(文章主表) dede_addonXXXX(附加表) 使用d ...
- 夺命雷公狗---微信开发57----微网站之jquery_mobile之入门案例
这节课我们主要用到到jquery_mobile来实现一个点电影播放网站 jquery_mobile(简称JQM)其实就是基于jquery开发出来的一套移动端框架,适应移动用户端市场对浏览与体验从而进一 ...
- 【crunch bang】调整窗口大小
在终端下, <super> + 上箭头 == 向上调整大小 <super> + 下箭头(左.右)
- jquery 下拉菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- asp.net中获得客户端的IP地址
asp.net中获得客户端的IP地址 因为要在项目中取到客户端IP,在网上搜了下相关资料,其中有一篇文章总结的比较详细,这里就把一些我用的上总结一下 方便以后查阅. 通常我们都通过下面的代码获得IP ...
- Ajax错误 “SCRIPT7002: XMLHttpRequest: 网络错误 0x2ef3, 由于出现错误 00002ef3 而导致此项操作无法完成” 的归纳总结
最近在做Asp.net项目的时候,用Ajax访问服务器数据有时候老是莫名其妙的报错:SCRIPT7002: XMLHttpRequest: 网络错误 0x2ef3, 由于出现错误 00002ef3 而 ...
- js编写规范
JavaScript编码规范 Bug----33条 1. 不要使用’==’和’!=’,使用’===’和’!==’替代 等级:Major 原因:==和!=在判断值相等前会判断类型是否相等.这容易因为类型 ...
- decimal.tostring()格式
nt/Decimal.ToString 方法 (String, IFormatProvider) decimal value = 16325.62m; string specifier; Cult ...