What:理解Intent filter

1.It, in effect, filters in intents of a desired type, while filtering out unwanted intents — but only unwanted implicit intents (those that don‘t namea target class). An explicit intent is always delivered to its target, no matter what it contains;
the filter is not consulted. But an implicit intent is delivered to a component only if it can pass through one of the component‘s filters.(即filter只对没有指名目标的Intent进行过滤,广播?)

2.一个妙用就是,一个应用程序可以启动另一个应用程序的某个功能模块

3.Android system must know about the capabilities of a component before it can launch that component

4.A filter has fields that parallel the action, data, and category fields of an Intent object. An implicit intent is tested against the filter in all three areas.If it fails even one of them, the Android system won‘t deliver it to the component

5.However, since a component can have multiple intent filters, an intent that does not pass through one of a component‘s filters might make it through on another.

6.an Intent object that doesn‘t specify an action automatically passes the test — as long as the filter contains at least one action.

7.An Intent object is a bundle of information. It contains
information of interest to the component that receives the intent (such as the action to be taken and the data to act on) plus information of interest to the Android system (such as the category of component that should handle the intent and instructions on
how to launch a target activity).

时间: 2024-08-12 03:06:29

What:理解Intent filter的相关文章

Android中Intent对象与Intent Filter过滤匹配过程详解

如果对Intent不是特别了解,可以参见博文<Android中Intent概述及使用>,该文对本文要使用的action.category以及data都进行了详细介绍. 本文内容有点长,希望大家可以耐心读完. 本文在描述组件在manifest中注册的Intent Filter过滤器时,统一用intent-filter表示. 概述 我们知道,Intent是分两种的:显式Intent和隐式Intent.如果一个Intent明确指定了要启动的组件的完整类名,那么这个Intent就是显式Intent,否

intent filter 应该叫 intent picker 或 intent receiver 更合乎语义

安卓的开发者指南上说: The system will deliver an implicit intent to your app component only if the intent can pass through one of your intent filters. filter 的一般含义意指过滤掉不需要的事物, 只留下需要的.它的主要功能应该是"滤除", 而不是"保留".应该用在有大量的备选对象的情景之下,用于去除多数不合乎需求的对象, 仅留下需要

Android笔记六.深入理解Intent和IntentFilter(二)

深入理解Intent和IntentFiler(二) Jiangdg_VIP http://blog.csdn.net/u012637501 在上一篇文章中,我们比较详细学习了"Intent"的相关知识,现在将学习如何设置Intent对象的这些属性以及如何使用他们来启动组件.Intent对象是一组信息,我们可以通过设置其Action.Data.Category属性来指定启动哪个组件并完成什么样的动作(包含动作所需的数据). "意图"分为显示intent和隐式inten

Intent Filter match过程源码分析

主流程 主线流程:先match action, 再match data, 最后match category 时序图 简化后的代码 public final int match(String action, String type, String scheme, Uri data, Set<String> categories, String logTag) { if (action != null && !matchAction(action)) { return NO_MAT

Intent 和 Intent Filter简介

Intent 和 Intent Filter Intent 是一个消息对象,你可以用它向另一个 app 组件发生动作请求.尽管 Intent 在促进组件间沟通的方式有多种,主要有个以下三种基本方式: 1.启动一个 Activity: 一个 Activity 代表 app 中一个单独的 screen.你可以通过为 startActivity() 方法传入一个 Intent 对象来启动一个 Activity 对象.Intent 描述要启动的 Activity, 并携带该 activity 启动所必须

intent Filter

intent Filter 一.介绍 如果一个 Intent 请求在一片数据上执行一个动作, Android 如何知道哪个应用程序(和组件)能用来响应这个请求呢? Intent Filter就是 用来注册 Activity . Service 和 Broadcast Receiver 具有能在某种数据上执行一个动作的能力.使用 Intent Filter ,应用程序组件告诉 Android ,它们能为其它程序的组件的动作请求提供服务,包括同一个程序的组件.本地的或第三方的应用程序. 为了注册一个

你必须弄懂的Intent Filter匹配规则

Intent简介 Android中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将 Intent传递给调用的组件,并完成组件的调用.Intent不仅可用于应用程序之间,也可用于应用程序内部的Activity/Service之间的交互.因此,Intent在这里起着一个媒体中介的作用,专门提供组件互相调用的相关信息,实现调用者与被调用者之间的解耦.在SDK中给出了I

深入理解Intent和IntentFiler(一)

http://blog.csdn.net/u012637501/article/details/41080891 为了比较深刻的理解并灵活使用Intent,我计划将这部分的学习分为两步:一是深入理解Intent基本概念以及其类:二是,通过实例来阐述如何灵活使用Intent来启动一个组件以及实现组件之间的传递数据. 一.什么是Intent,有什么作用? Android的应用程序包括四大组件:Activity.contentProvider.Service.BroadcastReceiver,为了方

Android Google官方文档(cn)解析之——Intents and Intent filter

应用程序核心组件中的三个Activity,service,还有broadcast receiver都是通过一个叫做intent的消息激活的.Intent消息传送是在相同或不同的应用程序中的组件之间后运行时绑定的一个设施.Intent对象也就是它自己是一个数据结构,这个数据结构持有将要执行操作的抽象描述,或者在broadcast的情况下,是一个已经发生而将要宣布的描述.为传递intent到每个不同类型的组件有单独的机制: 一个Intent对象被传递到Context.startActivity()或