Intent()
Create an empty intent.
|
|
Intent( Intent o)
Copy constructor.
|
|
Intent( String action)
Create an intent with a given action.
|
|
Intent( String action, Uri uri)
Create an intent with a
given action and for a given
data url.
|
|
Intent( Context packageContext, Class<?> cls)
Create an intent for
a specific component.
|
|
Intent( String action, Uri uri, Context packageContext, Class<?> cls)
Create an intent for a specific component with a specified action and data.
|
Intent it = new Intent(Intent.ACTION_VIEW); it.putExtra("sms_body", "The SMS text"); it.setType("vnd.android-dir/mms-sms"); startActivity(it);
<span style="white-space:pre"> </span>Intent it = new Intent(Main.this,Second.class); startActivity(it);
Intent it = new Intent(); it.setAction("message"); it.putExtra("message ", msg); sendBroadcast(it);
Intent it = new Intent(Main.this,Second.class); startService(it); stopService(it);
Intent
|
addCategory(String category)
Add a new category to the intent.
|
Intent
|
addFlags(int flags)
Add additional flags to the intent (or with existing flags value).
|
Object
|
clone()
Creates and returns a copy of this
Object .
|
Intent
|
cloneFilter()
Make a clone of only the parts of the Intent that are relevant for filter matching: the action, data, type, component, and categories.
|
static Intent
|
createChooser(Intent target, CharSequence title)
Convenience function for
creating a ACTION_CHOOSER Intent.
|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
|
int
|
fillIn( Intent other, int flags)
Copy the contents of other in to this object, but only where fields are not defined by this object.
|
boolean
|
filterEquals( Intent other)
Determine if two intents are the same for the purposes of intent resolution (filtering).
|
int
|
filterHashCode()
Generate hash code that matches semantics of filterEquals().
|
String
|
getAction()
Retrieve the general action to be performed, such as
ACTION_VIEW .
|
boolean[]
|
getBooleanArrayExtra( String name)
Retrieve extended data from the intent.
|
boolean
|
getBooleanExtra( String name, boolean defaultValue)
Retrieve extended data from the intent.
|
Bundle
|
getBundleExtra( String name)
Retrieve extended data from the intent.
|
byte[]
|
getByteArrayExtra( String name)
Retrieve extended data from the intent.
|
byte
|
getByteExtra( String name, byte defaultValue)
Retrieve extended data from the intent.
|
Set< String>
|
getCategories()
Return the set of all categories in the intent.
|
char[]
|
getCharArrayExtra( String name)
Retrieve extended data from the intent.
|
char
|
getCharExtra( String name, char defaultValue)
Retrieve extended data from the intent.
|
CharSequence[]
|
getCharSequenceArrayExtra( String name)
Retrieve extended data from the intent.
|
ArrayList< CharSequence>
|
getCharSequenceArrayListExtra( String name)
Retrieve extended data from the intent.
|
CharSequence
|
getCharSequenceExtra( String name)
Retrieve extended data from the intent.
|
ClipData
|
getClipData()
Return the
ClipData associated with this Intent.
|
ComponentName
|
getComponent()
Retrieve the concrete component associated with the intent.
|
Uri
|
getData()
Retrieve data this intent is operating on.
|
String
|
getDataString()
The same as
getData() , but returns the URI as an encoded String.
|
double[]
|
getDoubleArrayExtra( String name)
Retrieve extended data from the intent.
|
double
|
getDoubleExtra( String name, double defaultValue)
Retrieve extended data from the intent.
|
Bundle
|
getExtras()
Retrieves a map of extended data from the intent.
|
int
|
getFlags()
Retrieve any special flags associated with this intent.
|
float[]
|
getFloatArrayExtra( String name)
Retrieve extended data from the intent.
|
float
|
getFloatExtra( String name, float defaultValue)
Retrieve extended data from the intent.
|
int[]
|
getIntArrayExtra( String name)
Retrieve extended data from the intent.
|
int
|
getIntExtra( String name, int defaultValue)
Retrieve extended data from the intent.
|
ArrayList< Integer>
|
getIntegerArrayListExtra( String name)
Retrieve extended data from the intent.
|
static Intent
|
getIntent( String uri)
This method was deprecated in API level 4. Use parseUri(String, int) instead.
|
static Intent
|
getIntentOld( String uri)
|
long[]
|
getLongArrayExtra( String name)
Retrieve extended data from the intent.
|
long
|
getLongExtra( String name, long defaultValue)
Retrieve extended data from the intent.
|
String
|
getPackage()
Retrieve the application package name this Intent is limited to.
|
Parcelable[]
|
getParcelableArrayExtra( String name)
Retrieve extended data from the intent.
|
<T extends Parcelable> ArrayList<T>
|
getParcelableArrayListExtra( String name)
Retrieve extended data from the intent.
|
<T extends Parcelable> T
|
getParcelableExtra( String name)
Retrieve extended data from the intent.
|
String
|
getScheme()
Return the scheme portion of the intent's data.
|
Intent
|
getSelector()
Return the specific selector associated with this Intent.
|
Serializable
|
getSerializableExtra( String name)
Retrieve extended data from the intent.
|
short[]
|
getShortArrayExtra( String name)
Retrieve extended data from the intent.
|
short
|
getShortExtra( String name, short defaultValue)
Retrieve extended data from the intent.
|
Rect
|
getSourceBounds()
Get the bounds of the sender of this intent, in screen coordinates.
|
String[]
|
getStringArrayExtra( String name)
Retrieve extended data from the intent.
|
ArrayList< String>
|
getStringArrayListExtra( String name)
Retrieve extended data from the intent.
|
String
|
getStringExtra( String name)
Retrieve extended data from the intent.
|
String
|
getType()
Retrieve any explicit MIME type included in the intent.
|
boolean
|
hasCategory( String category)
Check if a category exists in the intent.
|
boolean
|
hasExtra( String name)
Returns true if an extra value is associated with the given name.
|
boolean
|
hasFileDescriptors()
Returns true if the Intent's extras contain a parcelled file descriptor.
|
static Intent
|
makeMainActivity( ComponentName mainActivity)
Create an intent to launch the main (root) activity of a task.
|
static Intent
|
makeMainSelectorActivity( String selectorAction, String selectorCategory)
Make an Intent for the main activity of an application, without specifying a specific activity to run but giving a selector to find the activity.
|
static Intent
|
makeRestartActivityTask( ComponentName mainActivity)
Make an Intent that can be used to re-launch an application's task in its base state.
|
static String
|
normalizeMimeType( String type)
Normalize a MIME data type.
|
static Intent
|
parseIntent( Resources resources, XmlPullParser parser, AttributeSet attrs)
Parses(解析) the "intent" element (and its children) from XML and instantiates an Intent object.
|
static Intent
|
parseUri( String uri, int flags)
Create an intent from a URI.
|
Intent
|
putCharSequenceArrayListExtra( String name, ArrayList< CharSequence> value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, double[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, int value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, CharSequence value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, char value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, Bundle value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, Parcelable[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, Serializable value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, int[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, float value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, byte[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, long[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, Parcelable value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, float[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, long value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, String[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, boolean value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, boolean[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, short value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, double value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, short[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, String value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, byte value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, char[] value)
Add extended data to the intent.
|
Intent
|
putExtra( String name, CharSequence[] value)
Add extended data to the intent.
|
Intent
|
putExtras( Intent src)
Copy all extras in 'src' in to this intent.
|
Intent
|
putExtras( Bundle extras)
Add a set of extended data to the intent.
|
Intent
|
putIntegerArrayListExtra( String name, ArrayList< Integer> value)
Add extended data to the intent.
|
Intent
|
putParcelableArrayListExtra( String name, ArrayList<? extends Parcelable> value)
Add extended data to the intent.
|
Intent
|
putStringArrayListExtra( String name, ArrayList< String> value)
Add extended data to the intent.
|
void
|
readFromParcel( Parcel in)
|
void
|
removeCategory( String category)
Remove a category from an intent.
|
void
|
removeExtra( String name)
Remove extended data from the intent.
|
Intent
|
replaceExtras( Bundle extras)
Completely replace the extras in the Intent with the given Bundle of extras.
|
Intent
|
replaceExtras( Intent src)
Completely replace the extras in the Intent with the extras in the given Intent.
|
ComponentName
|
resolveActivity( PackageManager pm)
Return the Activity component that should be used to handle this intent.
|
ActivityInfo
|
resolveActivityInfo( PackageManager pm, int flags)
Resolve the Intent into an
ActivityInfo describing the activity that should execute the intent.
|
String
|
resolveType( ContentResolver resolver)
Return the MIME data type of this intent.
|
String
|
resolveType( Context context)
Return the MIME data type of this intent.
|
String
|
resolveTypeIfNeeded( ContentResolver resolver)
Return the MIME data type of this intent, only if it will be needed for intent resolution.
|
Intent
|
setAction( String action)
Set the general action to be performed.
|
Intent
|
setClass( Context packageContext, Class<?> cls)
Convenience for calling setComponent(ComponentName) with the name returned by a Class object.
|
Intent
|
setClassName( Context packageContext, String className)
Convenience for calling setComponent(ComponentName) with an explicit class name.
|
Intent
|
setClassName( String packageName, String className)
Convenience for calling
setComponent(ComponentName) with an explicit application package name and class name.
|
void
|
setClipData( ClipData clip)
Set a
ClipData associated with this Intent.
|
Intent
|
setComponent( ComponentName component)
(Usually optional) Explicitly set the component to handle the intent.
|
Intent
|
setData( Uri data)
Set the data this intent is operating on.
|
Intent
|
setDataAndNormalize( Uri data)
Normalize and set the data this intent is operating on.
|
Intent
|
setDataAndType( Uri data, String type)
(Usually optional) Set the data for the intent along with an explicit MIME data type.
|
Intent
|
setDataAndTypeAndNormalize( Uri data, String type)
(Usually optional) Normalize and set both the data Uri and an explicit MIME data type.
|
void
|
setExtrasClassLoader( ClassLoader loader)
Sets the ClassLoader that will be used when unmarshalling any Parcelable values from the extras of this Intent.
|
Intent
|
setFlags(int flags)
Set special flags controlling how this intent is handled.
|
Intent
|
setPackage( String packageName)
(Usually optional) Set an explicit application package name that limits the components this Intent will resolve to.
|
void
|
setSelector( Intent selector)
Set a selector for this Intent.
|
void
|
setSourceBounds( Rect r)
Set the bounds of the sender of this intent, in screen coordinates.
|
Intent
|
setType( String type)
Set an explicit MIME data type.
|
Intent
|
setTypeAndNormalize( String type)
Normalize and set an explicit MIME data type.
|
String
|
toString()
Returns a string containing a concise(简洁), human-readable (可读)description of this object.
|
String
|
toURI()
This method was deprecated in API level 4. Use toUri(int) instead.
|
String
|
toUri(int flags)
Convert this Intent into a String holding a URI representation of it.
|
void
|
writeToParcel( Parcel out, int flags)
Flatten this object in to a Parcel.
|
ACTION_MAIN //传递返回到主Activity动作
ACTION_VIEW //传递显示动作
ACTION_ATTACH_DATA
ACTION_EDIT //传递编辑动作
ACTION_PICK
ACTION_CHOOSER //传递选择动作
ACTION_GET_CONTENT
ACTION_DIAL
ACTION_CALL
ACTION_SEND
ACTION_SENDTO
ACTION_ANSWER //传递接听电话动作
ACTION_INSERT
ACTION_DELETE
ACTION_RUN
ACTION_SYNC
ACTION_PICK_ACTIVITY
ACTION_SEARCH
ACTION_WEB_SEARCH
ACTION_FACTORY_TEST
ACTION_TIME_TICK
ACTION_TIME_CHANGED
ACTION_TIMEZONE_CHANGED
ACTION_BOOT_COMPLETED
ACTION_PACKAGE_ADDED
ACTION_PACKAGE_CHANGED
ACTION_PACKAGE_REMOVED
ACTION_PACKAGE_RESTARTED
ACTION_PACKAGE_DATA_CLEARED
ACTION_UID_REMOVED
ACTION_BATTERY_CHANGED
ACTION_POWER_CONNECTED
ACTION_POWER_DISCONNECTED
ACTION_SHUTDOWN
CATEGORY_DEFAULT
CATEGORY_BROWSABLE
CATEGORY_TAB
CATEGORY_ALTERNATIVE
CATEGORY_SELECTED_ALTERNATIVE
CATEGORY_LAUNCHER
CATEGORY_INFO
CATEGORY_HOME
CATEGORY_PREFERENCE
CATEGORY_TEST
CATEGORY_CAR_DOCK
CATEGORY_DESK_DOCK
CATEGORY_LE_DESK_DOCK
CATEGORY_HE_DESK_DOCK
CATEGORY_CAR_MODE
CATEGORY_APP_MARKET
EXTRA_ALARM_COUNT
EXTRA_BCC
EXTRA_CC
EXTRA_CHANGED_COMPONENT_NAME
EXTRA_DATA_REMOVED
EXTRA_DOCK_STATE
EXTRA_DOCK_STATE_HE_DESK
EXTRA_DOCK_STATE_LE_DESK
EXTRA_DOCK_STATE_CAR
EXTRA_DOCK_STATE_DESK
EXTRA_DOCK_STATE_UNDOCKED
EXTRA_DONT_KILL_APP
EXTRA_EMAIL
EXTRA_INITIAL_INTENTS
EXTRA_INTENT
EXTRA_KEY_EVENT
EXTRA_ORIGINATING_URI
EXTRA_PHONE_NUMBER
EXTRA_REFERRER
EXTRA_REMOTE_INTENT_TOKEN
EXTRA_REPLACING
EXTRA_SHORTCUT_ICON
EXTRA_SHORTCUT_ICON_RESOURCE
EXTRA_SHORTCUT_INTENT
EXTRA_STREAM
EXTRA_SHORTCUT_NAME
EXTRA_SUBJECT
EXTRA_TEMPLATE
EXTRA_TEXT
EXTRA_TITLE
EXTRA_UID
getFlags()
addFlags(int)
FLAG_GRANT_READ_URI_PERMISSION
FLAG_GRANT_WRITE_URI_PERMISSION
FLAG_GRANT_PERSISTABLE_URI_PERMISSION
FLAG_GRANT_PREFIX_URI_PERMISSION
FLAG_DEBUG_LOG_RESOLUTION
FLAG_FROM_BACKGROUND
FLAG_ACTIVITY_BROUGHT_TO_FRONT
FLAG_ACTIVITY_CLEAR_TASK
FLAG_ACTIVITY_CLEAR_TOP
FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
FLAG_ACTIVITY_FORWARD_RESULT
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
FLAG_ACTIVITY_MULTIPLE_TASK
FLAG_ACTIVITY_NEW_DOCUMENT
FLAG_ACTIVITY_NEW_TASK
FLAG_ACTIVITY_NO_ANIMATION
FLAG_ACTIVITY_NO_HISTORY
FLAG_ACTIVITY_NO_USER_ACTION
FLAG_ACTIVITY_PREVIOUS_IS_TOP
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
FLAG_ACTIVITY_REORDER_TO_FRONT
FLAG_ACTIVITY_SINGLE_TOP
FLAG_ACTIVITY_TASK_ON_HOME
FLAG_RECEIVER_REGISTERED_ONLY