Intent.java Analysis

Source: Internet
Author: User

Code in Frameworks/base/core/java/anroid/content/intent.java

Intent is an abstract description of the action to be performed. Use the action abstract operation to abstract the operation parameters with data (Android.net.Uri).

In addition, the category is used to describe the class to which the action belongs (adding an additional property of the action corresponding to the component) to guide how the corresponding component is matched and processed, and type is used to specify the MIME type of data component Specifies the component used to execute the action, and if this is specified, the other parameters are ignored; Extra is used to attach additional required parameters to the component corresponding method.

First call the package Android.content and import these classes

1 17package android.content;2  -3 19import android.annotation.AnyRes;4 20import Android.annotation.IntDef;5 21import android.annotation.SdkConstant;6 22import Android.annotation.SdkConstant.SdkConstantType;7 23import Android.annotation.SystemApi;8 24import Android.content.pm.ActivityInfo;9 25import Android.content.pm.ApplicationInfo;Ten 26import Android.content.pm.ComponentInfo; One 27import Android.content.pm.PackageManager; A 28import Android.content.pm.ResolveInfo; - 29import android.content.res.Resources; - 30import Android.content.res.TypedArray; the 31import Android.graphics.Rect; - 32import Android.net.Uri; - 33import Android.os.Build; - 34import Android.os.Bundle; + 35import Android.os.IBinder; - 36import Android.os.Parcel; + 37import android.os.Parcelable; A 38import android.os.Process; at 39import Android.os.ResultReceiver; - 40import Android.os.ShellCommand; - 41import Android.os.StrictMode; - 42import Android.os.UserHandle; - 43import android.provider.DocumentsContract; - 44import Android.provider.DocumentsProvider; in 45import Android.provider.MediaStore; - 46import android.provider.OpenableColumns; to 47import Android.util.ArraySet; + 48import Android.util.AttributeSet; - 49import Android.util.Log; the50import com.android.Internal. util. Xmlutils; * 51import Org.xmlpull.v1.XmlPullParser; $ 52import org.xmlpull.v1.XmlPullParserException;Panax Notoginseng 53import Org.xmlpull.v1.XmlSerializer; -  Wu the 55import java.io.IOException; + 56import Java.io.PrintWriter; A 57import java.io.Serializable; the 58import java.lang.annotation.Retention; + 59import Java.lang.annotation.RetentionPolicy; - 60import java.net.URISyntaxException; $ 61import java.util.ArrayList; $ 62import Java.util.HashSet; - 63import java.util.List; - 64import Java.util.Locale; the 65import java.util.Objects; - 66import Java.util.Set;Wuyi  the the68importStaticAndroid.content.ContentProvider.maybeAddUserId;

This class implements the Parcelable and Cloneable interfaces

1 619publicclass Intent implements Parcelable, cloneable {

The defined attr string has Action,category,type,component,data,flags

1 620    Private StaticFinal String attr_action ="Action";2 622    Private StaticFinal String attr_category ="category";3 624    Private StaticFinal String Attr_type ="type";4 625    Private StaticFinal String attr_component ="Component";5 626    Private StaticFinal String Attr_data ="Data";6 627    Private StaticFinal String attr_flags ="Flags";

Tag string has Categories,extra

1 621    Private Static " Categories " ; 2 623    Private Static " Extra ";

Intent.java Analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.