Lines Matching defs:Intent

81  * can be used with {@link Context#startActivity(Intent) startActivity} to
83 * {@link android.content.Context#sendBroadcast(Intent) broadcastIntent} to
89 * <p>An Intent provides a facility for performing late runtime binding between the code in
97 * <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>
102 * <h3>Intent Structure</h3>
164 * all of the other Intent attributes become optional.</p>
196 * <p>There are a variety of standard Intent action and category constants
197 * defined in the Intent class, but applications can also define their own.
210 * <h3>Intent Resolution</h3>
228 * know what to do with it. This is handled by the process of <em>Intent
229 * resolution</em>, which maps an Intent to an {@link android.app.Activity},
234 * Intent against all of the &lt;intent-filter&gt; descriptions in the
240 * <p>There are three pieces of information in the Intent that are used for
250 * <li> <p>The <b>type</b> is retrieved from the Intent's data, if not
251 * already supplied in the Intent. Like the action, if a type is
255 * type is included in the Intent, instead the <b>scheme</b> of the
343 * the Intent), and the LAUNCHER category says that this entry point should be
461 * the Intent), but here we show a way you can publish alternative
506 * <p>These are the current standard actions that Intent defines for launching
536 * <p>These are the current standard actions that Intent defines for receiving
562 * clarify an Intent via {@link #addCategory}.
625 * <p>These are the possible flags that can be used in the Intent via
629 public class Intent implements Parcelable, Cloneable {
744 * <p>Output: An Intent representing the {@link android.content.pm.ShortcutInfo} result.</p>
746 * extras: SHORTCUT_INTENT (value: Intent), SHORTCUT_NAME (value: String),
755 * @see android.content.Intent.ShortcutIconResource
761 * The name of the extra used to define the Intent of a shortcut.
788 * @see android.content.Intent.ShortcutIconResource
819 * @see Intent#ACTION_CREATE_SHORTCUT
820 * @see Intent#EXTRA_SHORTCUT_ICON_RESOURCE
917 * the permissions to be granted on the ACTION_CHOOSER Intent
923 * As a convenience, an Intent of this form can be created with the
927 * a {@link #EXTRA_INTENT} field containing the Intent being executed,
937 * Convenience function for creating a {@link #ACTION_CHOOSER} Intent.
939 * <p>Builds a new {@link #ACTION_CHOOSER} Intent that wraps the given
947 * @param target The Intent that the user will be selecting an activity
950 * @return Return a new Intent object that you can hand to
951 * {@link Context#startActivity(Intent) Context.startActivity()} and
954 public static Intent createChooser(Intent target, CharSequence title) {
959 * Convenience function for creating a {@link #ACTION_CHOOSER} Intent.
961 * <p>Builds a new {@link #ACTION_CHOOSER} Intent that wraps the given
974 * @param target The Intent that the user will be selecting an activity
978 * @return Return a new Intent object that you can hand to
979 * {@link Context#startActivity(Intent) Context.startActivity()} and
982 public static Intent createChooser(Intent target, CharSequence title, IntentSender sender) {
983 Intent intent = new Intent(ACTION_CHOOSER);
1029 * data you want and launch it with {@link Context#startActivity(Intent)}.
1047 * accomplished by requiring the {@link #CATEGORY_OPENABLE} in the Intent.
1093 * <p>Note: this Intent <strong>cannot</strong> be used to call emergency
1170 * it will be copied there for you when calling {@link Context#startActivity(Intent)}.
1214 * it will be copied there for you when calling {@link Context#startActivity(Intent)}.
1278 * <p>Input: get*Extra field {@link #EXTRA_INTENT} is an Intent
1613 * invoking the Intent. For this to work you must start the installer with
1621 * {@link #ACTION_VIEW} to indicate the URI from which the local APK in the Intent
1628 * This extra can be used with any Intent used to launch an activity, supplying information
1648 * not be created, in particular when Intent extras are supplied through the
1801 * Intent extra: A callback for reporting remote result as a bundle.
1812 * Intent extra: An app package name.
1821 * Intent extra: A {@link Bundle} of extras for a package being suspended. Will be sent as an
1836 * Intent extra: An app split name.
1844 * Intent extra: A {@link ComponentName} value.
1852 * Intent extra: An extra for specifying whether a result is needed.
1863 * Intent extra: A {@link Bundle} of extras supplied for the launcher when any packages on
1893 * Intent extra: The name of a permission.
2144 * that is being removed does <em>not</em> receive this Intent.
2528 * contents of the Intent.
2740 * The path to the mount point for the removed media is contained in the Intent.mData field.
2747 * The path to the mount point for the unmounted media is contained in the Intent.mData field.
2754 * The path to the mount point for the checking media is contained in the Intent.mData field.
2761 * The path to the mount point for the checking media is contained in the Intent.mData field.
2768 * The path to the mount point for the mounted media is contained in the Intent.mData field.
2769 * The Intent contains an extra with name "read-only" and Boolean value to indicate if the
2777 * The path to the mount point for the shared media is contained in the Intent.mData field.
2784 * The path to the mount point for the previously shared media is contained in the Intent.mData field.
2792 * The path to the mount point for the removed media is contained in the Intent.mData field.
2799 * The path to the mount point for the unmountable media is contained in the Intent.mData field.
2807 * The path to the mount point for the media to be ejected is contained in the Intent.mData field.
2814 * The path to the directory being scanned is contained in the Intent.mData field.
2821 * The path to the scanned directory is contained in the Intent.mData field.
2828 * The path to the file is contained in the Intent.mData field.
2957 * <p>The Intent will have the following extra value:</p>
2959 * <li><em>{@link android.content.Intent#EXTRA_PHONE_NUMBER}</em> -
2976 * <p>Any BroadcastReceiver receiving this Intent <em>must not</em>
2987 * permission to receive this Intent.</p>
3036 * {@link BroadcastReceiver#onReceive(Context, Intent)}, rather start a
3037 * maintenance service by {@link Context#startService(Intent)}. Also
3067 * {@link BroadcastReceiver#onReceive(Context, Intent)}, rather stop the
3122 * contain an extra {@link #EXTRA_RESTRICTIONS_INTENT}, which is of type <code>Intent</code>.
3421 * Callers must include {@link #CATEGORY_OPENABLE} in the Intent to obtain
3463 * Callers must include {@link #CATEGORY_OPENABLE} in the Intent to obtain
4019 * Intent when initiating an action -- it is for use in intent filters
4027 * and clicks on a link in the text, the Intent generated execute that
4032 * matching Intent.
4265 * <p>NOTE: This should not be used as the primary key of an Intent,
4269 * Intent with this category in the selector.</p>
4277 * <p>NOTE: This should not be used as the primary key of an Intent,
4281 * Intent with this category in the selector.</p>
4289 * <p>NOTE: This should not be used as the primary key of an Intent,
4293 * Intent with this category in the selector.</p>
4301 * <p>NOTE: This should not be used as the primary key of an Intent,
4305 * Intent with this category in the selector.</p>
4313 * <p>NOTE: This should not be used as the primary key of an Intent,
4317 * Intent with this category in the selector.</p>
4326 * <p>NOTE: This should not be used as the primary key of an Intent,
4330 * Intent with this category in the selector.</p>
4338 * <p>NOTE: This should not be used as the primary key of an Intent,
4342 * Intent with this category in the selector.</p>
4350 * <p>NOTE: This should not be used as the primary key of an Intent,
4354 * Intent with this category in the selector.</p>
4363 * <p>NOTE: This should not be used as the primary key of an Intent,
4367 * Intent with this category in the selector.</p>
4385 * A constant CharSequence that is associated with the Intent, used with
4394 * A constant String that is associated with the Intent, used with
4402 * A content: URI holding a stream of data associated with the Intent,
4428 * An Intent describing the choices you would like shown with
4450 * An Intent[] describing additional, alternate choices you would like shown with
4569 * {@link #fillIn(Intent, int) filled in} to that {@link IntentSender} and sent
4576 * to match and fill in the final Intent or ChooserTarget before starting it.
4577 * The supplied intent must {@link #filterEquals(Intent) match} one of the intents from
4596 * A Parcelable[] of {@link Intent} or
4700 * that it did or did not have an app for the sanitized {@link Intent} defined at
4789 * triggered the creation of the Intent it is in.
4811 * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} or
4812 * {@link android.content.Intent#ACTION_PACKAGE_CHANGED} intents to override the default action
4819 * {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL}, or the actual
4820 * number to call in a {@link android.content.Intent#ACTION_CALL}.
4825 * Used as an int extra field in {@link android.content.Intent#ACTION_UID_REMOVED}
4827 * extra in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} or
4828 * {@link android.content.Intent#ACTION_PACKAGE_CHANGED} for the same
4840 * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED}
4849 * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED}
4857 * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED}
4875 * Used as an int extra field in {@link android.content.Intent#ACTION_DOCK_EVENT}
4877 * {@link android.content.Intent#EXTRA_DOCK_STATE_UNDOCKED},
4878 * {@link android.content.Intent#EXTRA_DOCK_STATE_DESK}, or
4879 * {@link android.content.Intent#EXTRA_DOCK_STATE_CAR}, or
4880 * {@link android.content.Intent#EXTRA_DOCK_STATE_LE_DESK}, or
4881 * {@link android.content.Intent#EXTRA_DOCK_STATE_HE_DESK}.
4886 * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE}
4892 * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE}
4898 * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE}
4904 * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE}
4910 * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE}
4942 * This field is part of {@link android.content.Intent#ACTION_PACKAGE_CHANGED},
4952 * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE},
4953 * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE},
4954 * {@link android.content.Intent#ACTION_PACKAGES_SUSPENDED},
4955 * {@link android.content.Intent#ACTION_PACKAGES_UNSUSPENDED}
4963 * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE},
4964 * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE}
5010 * of the result Intent.
5097 * Intent extra: the reason that the operation associated with this intent is being performed.
5152 * {@link Intent#ACTION_QUICK_VIEW} intent.
5221 // Intent flags (see mFlags variable).
5243 return (modeFlags & (Intent.FLAG_GRANT_READ_URI_PERMISSION
5244 | Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) != 0;
5340 * If set, the recipient of this Intent will be granted permission to
5341 * perform read operations on the URI in the Intent's data and any URIs
5342 * specified in its ClipData. When applying to an Intent's ClipData,
5344 * in Intent items will be granted; only the grant flags of the top-level
5345 * Intent are used.
5349 * If set, the recipient of this Intent will be granted permission to
5350 * perform write operations on the URI in the Intent's data and any URIs
5351 * specified in its ClipData. When applying to an Intent's ClipData,
5353 * in Intent items will be granted; only the grant flags of the top-level
5354 * Intent are used.
5358 * Can be set by the caller to indicate that this Intent is coming from
5478 * search through existing tasks for ones matching this Intent. Only if no such
5489 * Intent, regardless of whether there is already an existing task running
5513 * all of the other activities on top of it will be closed and this Intent
5514 * will be delivered to the (now on top) old activity as a new Intent.
5517 * If D calls startActivity() with an Intent that resolves to the component
5519 * Intent, resulting in the stack now being: A, B.
5528 * Intent will be delivered to the current instance's onNewIntent().
5594 * by this Intent. Through the use of this flag, or its equivalent attribute,
5600 * preferred over the Intent flag described here. The attribute form allows the
5602 * whereas using this flag requires each Intent that launches the Activity to specify it.
5642 * If set in an Intent passed to {@link Context#startActivity Context.startActivity()},
5647 * If D calls startActivity() with an Intent that resolves to the component
5656 * If set in an Intent passed to {@link Context#startActivity Context.startActivity()},
5668 * If set in an Intent passed to {@link Context#startActivity Context.startActivity()},
5676 * If set in an Intent passed to {@link Context#startActivity Context.startActivity()},
5709 * If set in an Intent passed to {@link Context#startActivity Context.startActivity()},
5713 * When attempting to resolve instant apps externally, the following {@link Intent} properties
5716 * <li>{@link Intent#setAction(String)}</li>
5717 * <li>{@link Intent#addCategory(String)}</li>
5718 * <li>{@link Intent#setData(Uri)}</li>
5719 * <li>{@link Intent#setType(String)}</li>
5720 * <li>{@link Intent#setPackage(String)}</li>
5721 * <li>{@link Intent#addFlags(int)}</li>
5738 * by {@link Intent#filterEquals(Intent) Intent.filterEquals} returning
5841 * Intent vs. all others that should be treated as raw URIs. When used
5855 * android-app://{package_id}[/{scheme}[/{host}[/{path}]]][#Intent;{...}]</pre>
5859 * The final #Intent; fragment can be used without a scheme, host, or path.
5864 * <p>Some examples of how this scheme maps to Intent objects:</p>
5869 * <tr><th>URI</th> <th>Intent</th></tr>
5893 * <tr><td><code>android-app://com.example.app/<br />#Intent;action=com.example.MY_ACTION;end</code></td>
5899 * <tr><td><code>android-app://com.example.app/http/example.com/foo?1234<br />#Intent;action=com.example.MY_ACTION;end</code></td>
5906 * <tr><td><code>android-app://com.example.app/<br />#Intent;action=com.example.MY_ACTION;<br />i.some_int=100;S.some_str=hello;end</code></td>
5923 * generated Intent can not cause unexpected data access to happen.
5943 private Intent mSelector;
5967 public Intent() {
5973 public Intent(Intent o) {
5977 private Intent(Intent o, @CopyMode int copyMode) {
5996 this.mSelector = new Intent(o.mSelector);
6019 return new Intent(this);
6023 * Make a clone of only the parts of the Intent that are relevant for
6026 public @NonNull Intent cloneFilter() {
6027 return new Intent(this, COPY_MODE_FILTER);
6038 * @param action The Intent action, such as ACTION_VIEW.
6040 public Intent(String action) {
6057 * @param action The Intent action, such as ACTION_VIEW.
6058 * @param uri The Intent data URI.
6060 public Intent(String action, Uri uri) {
6079 * @see #Intent(String, android.net.Uri , Context, Class)
6081 public Intent(Context packageContext, Class<?> cls) {
6087 * This is equivalent to using {@link #Intent(String, android.net.Uri)} to
6088 * construct the Intent and then calling {@link #setClass} to set its
6097 * @param action The Intent action, such as ACTION_VIEW.
6098 * @param uri The Intent data URI.
6103 * @see #Intent(String, android.net.Uri)
6104 * @see #Intent(Context, Class)
6108 public Intent(String action, Uri uri,
6117 * is the Intent that is started when the application's is launched from
6119 * same way, it is important that they use an Intent structured the same
6122 * <p>The returned Intent has the given Activity component as its explicit
6126 * to do that through {@link #addFlags(int)} on the returned Intent.
6128 * @param mainActivity The main activity component that this Intent will
6130 * @return Returns a newly created Intent that can be used to launch the
6136 public static Intent makeMainActivity(ComponentName mainActivity) {
6137 Intent intent = new Intent(ACTION_MAIN);
6144 * Make an Intent for the main activity of an application, without
6146 * the activity. This results in a final Intent that is structured
6149 * same way, it is important that they use an Intent structured the same
6152 * <p>The returned Intent has {@link #ACTION_MAIN} as its action, and includes the
6155 * to do that through {@link #addFlags(int)} on the returned Intent.
6157 * @param selectorAction The action name of the Intent's selector.
6158 * @param selectorCategory The name of a category to add to the Intent's
6160 * @return Returns a newly created Intent that can be used to launch the
6163 * @see #setSelector(Intent)
6165 public static Intent makeMainSelectorActivity(String selectorAction,
6167 Intent intent = new Intent(ACTION_MAIN);
6169 Intent selector = new Intent();
6177 * Make an Intent that can be used to re-launch an application's task
6186 * @return Returns a newly created Intent that can be used to relaunch the
6189 public static Intent makeRestartActivityTask(ComponentName mainActivity) {
6190 Intent intent = makeMainActivity(mainActivity);
6191 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
6192 | Intent.FLAG_ACTIVITY_CLEAR_TASK);
6201 public static Intent getIntent(String uri) throws URISyntaxException {
6208 * {@link #toUri}. If the Intent was not generate by toUri(), its data
6214 * @param uri The URI to turn into an Intent.
6217 * @return Intent The newly created Intent object.
6220 * it bad (as parsed by the Uri class) or the Intent data within the
6225 public static Intent parseUri(String uri, @UriFlags int flags) throws URISyntaxException {
6233 Intent intent = new Intent(ACTION_VIEW);
6247 return new Intent(ACTION_VIEW, Uri.parse(uri));
6250 // old format Intent URI
6251 } else if (!uri.startsWith("#Intent;", i)) {
6260 Intent intent = new Intent(ACTION_VIEW);
6261 Intent baseIntent = intent;
6270 i += 8; // length of "#Intent;"
6275 // loop over contents of Intent, all name=value;
6334 intent = new Intent();
6362 // The Intent had a selector; fix it up.
6387 // Target the Intent at the given package name always.
6435 throw new URISyntaxException(uri, "illegal Intent URI format", i);
6439 public static Intent getIntentOld(String uri) throws URISyntaxException {
6443 private static Intent getIntentOld(String uri, int flags) throws URISyntaxException {
6444 Intent intent;
6462 intent = new Intent(action);
6596 intent = new Intent(ACTION_VIEW, Uri.parse(uri));
6608 public static Intent parseCommandArgs(ShellCommand cmd, CommandOptionHandler optionHandler)
6610 Intent intent = new Intent();
6611 Intent baseIntent = intent;
6831 intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
6834 intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
6837 intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
6840 intent.addFlags(Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
6843 intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
6846 intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
6849 intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
6852 intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
6855 intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
6858 intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
6861 intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
6864 intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
6867 intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
6870 intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
6873 intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
6876 intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
6879 intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
6882 intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
6885 intent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
6888 intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
6891 intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
6894 intent.addFlags(Intent.FLAG_ACTIVITY_TASK_ON_HOME);
6897 intent.addFlags(Intent.FLAG_ACTIVITY_MATCH_EXTERNAL);
6900 intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
6903 intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
6906 intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
6909 intent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT);
6912 intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
6916 intent = new Intent();
6941 // have been supplied for the main Intent, then we can
6945 baseIntent = new Intent(Intent.ACTION_MAIN);
6946 baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);
6951 baseIntent = Intent.parseUri(arg, Intent.URI_INTENT_SCHEME
6952 | Intent.URI_ANDROID_APP_SCHEME | Intent.URI_ALLOW_UNSAFE);
6954 // The argument is a component name. Build an Intent to launch
6956 baseIntent = new Intent(Intent.ACTION_MAIN);
6957 baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);
6961 baseIntent = new Intent(Intent.ACTION_MAIN);
6962 baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);
6976 intent.fillIn(baseIntent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_SELECTOR);
7204 * Return the specific selector associated with this Intent. If there is
7209 public @Nullable Intent getSelector() {
7214 * Return the {@link ClipData} associated with this Intent. If there is
7240 * any Parcelable values from the extras of this Intent.
7261 * Returns true if the Intent's extras contain a parcelled file descriptor.
7262 * @return true if the Intent contains a parcelled file descriptor.
7800 public Intent maybeStripForHistory() {
7806 return new Intent(this, COPY_MODE_HISTORY);
7830 * Retrieve the application package name this Intent is limited to. When
7831 * resolving an Intent, if non-null this limits the resolution to only
7834 * @return The name of the application package for the Intent.
7875 * <p>The activity must handle the {@link Intent#CATEGORY_DEFAULT} Intent
7905 * @param pm The package manager with which to resolve the Intent.
7931 * Resolve the Intent into an {@link ActivityInfo}
7937 * @param pm The package manager with which to resolve the Intent.
7969 * multiple potential matches to the Intent. Returns null if
8006 * @return Returns the same Intent object, for chaining multiple calls
8011 public @NonNull Intent setAction(@Nullable String action) {
8030 * @return Returns the same Intent object, for chaining multiple calls
8037 public @NonNull Intent setData(@Nullable Uri data) {
8058 * @return Returns the same Intent object, for chaining multiple calls
8065 public @NonNull Intent setDataAndNormalize(@NonNull Uri data) {
8086 * @return Returns the same Intent object, for chaining multiple calls
8094 public @NonNull Intent setType(@Nullable String type) {
8113 * setType(Intent.normalizeMimeType(type))
8118 * @return Returns the same Intent object, for chaining multiple calls
8125 public @NonNull Intent setTypeAndNormalize(@Nullable String type) {
8145 * @return Returns the same Intent object, for chaining multiple calls
8154 public @NonNull Intent setDataAndType(@Nullable Uri data, @Nullable String type) {
8170 * setDataAndType(data.normalize(), Intent.normalizeMimeType(type))
8176 * @return Returns the same Intent object, for chaining multiple calls
8185 public @NonNull Intent setDataAndTypeAndNormalize(@NonNull Uri data, @Nullable String type) {
8196 * predefined Intent categories, or a custom category in your own
8199 * @return Returns the same Intent object, for chaining multiple calls
8205 public @NonNull Intent addCategory(String category) {
8230 * Set a selector for this Intent. This is a modification to the kinds of
8231 * things the Intent will match. If the selector is set, it will be used
8232 * when trying to find entities that can handle the Intent, instead of the
8233 * main contents of the Intent. This allows you build an Intent containing
8238 * Intent that will launch the Browser application. However, the correct
8244 * Instead, you can build an Intent with the MAIN action (but no ComponentName
8249 * {@link #filterEquals(Intent)} and {@link #filterHashCode()}. This is part of the
8251 * of the Intent, just what kinds of things will be matched against it
8255 * the same base Intent.</p>
8257 * @param selector The desired selector Intent; set to null to not use
8260 public void setSelector(@Nullable Intent selector) {
8263 "Intent being set as a selector of itself");
8273 * Set a {@link ClipData} associated with this Intent. This replaces any
8276 * <p>The ClipData in an intent is not used for Intent matching or other
8278 * additional data with the Intent. The main feature of using this over
8282 * you want to transmit an Intent containing multiple <code>content:</code>
8288 * of the main Intent are respected, and will be applied to all Uri or
8289 * Intent items in the clip (or sub-items of the clip).
8292 * directly used by Intent. Applications should generally rely on the
8293 * MIME type of the Intent itself, not what it may find in the ClipData.
8294 * A common practice is to construct a ClipData for use with an Intent
8325 * @return Returns the same Intent object, for chaining multiple calls
8332 public @NonNull Intent putExtra(String name, boolean value) {
8348 * @return Returns the same Intent object, for chaining multiple calls
8355 public @NonNull Intent putExtra(String name, byte value) {
8371 * @return Returns the same Intent object, for chaining multiple calls
8378 public @NonNull Intent putExtra(String name, char value) {
8394 * @return Returns the same Intent object, for chaining multiple calls
8401 public @NonNull Intent putExtra(String name, short value) {
8417 * @return Returns the same Intent object, for chaining multiple calls
8424 public @NonNull Intent putExtra(String name, int value) {
8440 * @return Returns the same Intent object, for chaining multiple calls
8447 public @NonNull Intent putExtra(String name, long value) {
8463 * @return Returns the same Intent object, for chaining multiple calls
8470 public @NonNull Intent putExtra(String name, float value) {
8486 * @return Returns the same Intent object, for chaining multiple calls
8493 public @NonNull Intent putExtra(String name, double value) {
8509 * @return Returns the same Intent object, for chaining multiple calls
8516 public @NonNull Intent putExtra(String name, String value) {
8532 * @return Returns the same Intent object, for chaining multiple calls
8539 public @NonNull Intent putExtra(String name, CharSequence value) {
8555 * @return Returns the same Intent object, for chaining multiple calls
8562 public @NonNull Intent putExtra(String name, Parcelable value) {
8578 * @return Returns the same Intent object, for chaining multiple calls
8585 public @NonNull Intent putExtra(String name, Parcelable[] value) {
8601 * @return Returns the same Intent object, for chaining multiple calls
8608 public @NonNull Intent putParcelableArrayListExtra(String name,
8625 * @return Returns the same Intent object, for chaining multiple calls
8632 public @NonNull Intent putIntegerArrayListExtra(String name, ArrayList<Integer> value) {
8648 * @return Returns the same Intent object, for chaining multiple calls
8655 public @NonNull Intent putStringArrayListExtra(String name, ArrayList<String> value) {
8671 * @return Returns the same Intent object, for chaining multiple calls
8678 public @NonNull Intent putCharSequenceArrayListExtra(String name,
8695 * @return Returns the same Intent object, for chaining multiple calls
8702 public @NonNull Intent putExtra(String name, Serializable value) {
8718 * @return Returns the same Intent object, for chaining multiple calls
8725 public @NonNull Intent putExtra(String name, boolean[] value) {
8741 * @return Returns the same Intent object, for chaining multiple calls
8748 public @NonNull Intent putExtra(String name, byte[] value) {
8764 * @return Returns the same Intent object, for chaining multiple calls
8771 public @NonNull Intent putExtra(String name, short[] value) {
8787 * @return Returns the same Intent object, for chaining multiple calls
8794 public @NonNull Intent putExtra(String name, char[] value) {
8810 * @return Returns the same Intent object, for chaining multiple calls
8817 public @NonNull Intent putExtra(String name, int[] value) {
8833 * @return Returns the same Intent object, for chaining multiple calls
8840 public @NonNull Intent putExtra(String name, long[] value) {
8856 * @return Returns the same Intent object, for chaining multiple calls
8863 public @NonNull Intent putExtra(String name, float[] value) {
8879 * @return Returns the same Intent object, for chaining multiple calls
8886 public @NonNull Intent putExtra(String name, double[] value) {
8902 * @return Returns the same Intent object, for chaining multiple calls
8909 public @NonNull Intent putExtra(String name, String[] value) {
8925 * @return Returns the same Intent object, for chaining multiple calls
8932 public @NonNull Intent putExtra(String name, CharSequence[] value) {
8948 * @return Returns the same Intent object, for chaining multiple calls
8955 public @NonNull Intent putExtra(String name, Bundle value) {
8971 * @return Returns the same Intent object, for chaining multiple calls
8982 public @NonNull Intent putExtra(String name, IBinder value) {
8997 public @NonNull Intent putExtras(@NonNull Intent src) {
9018 public @NonNull Intent putExtras(@NonNull Bundle extras) {
9027 * Completely replace the extras in the Intent with the extras in the
9028 * given Intent.
9030 * @param src The exact extras contained in this Intent are copied
9033 public @NonNull Intent replaceExtras(@NonNull Intent src) {
9039 * Completely replace the extras in the Intent with the given Bundle of
9042 * @param extras The new set of extras in the Intent, or null to erase
9045 public @NonNull Intent replaceExtras(@NonNull Bundle extras) {
9066 * here depend on the type of component being executed by the Intent,
9070 * {@link Context#sendBroadcast(Intent) Context.sendBroadcast()}.
9078 * @return Returns the same Intent object, for chaining multiple calls
9084 public @NonNull Intent setFlags(@Flags int flags) {
9093 * @return Returns the same Intent object, for chaining multiple calls into
9099 public @NonNull Intent addFlags(@Flags int flags) {
9118 * the components this Intent will resolve to. If left to the default
9120 * If non-null, the Intent can only match the components in the given
9126 * @return Returns the same Intent object, for chaining multiple calls
9132 public @NonNull Intent setPackage(@Nullable String packageName) {
9145 * type, categories) in the Intent. If this class is defined, the
9155 * @return Returns the same Intent object, for chaining multiple calls
9164 public @NonNull Intent setComponent(@Nullable ComponentName component) {
9176 * that will be used as the component for this Intent.
9178 * @return Returns the same Intent object, for chaining multiple calls
9184 public @NonNull Intent setClassName(@NonNull Context packageContext,
9197 * that will be used as the component for this Intent.
9199 * @return Returns the same Intent object, for chaining multiple calls
9205 public @NonNull Intent setClassName(@NonNull String packageName, @NonNull String className) {
9219 * @return Returns the same Intent object, for chaining multiple calls
9224 public @NonNull Intent setClass(@NonNull Context packageContext, @NonNull Class<?> cls) {
9307 * being defined, the following pieces of data in the Intent are
9319 * <li> selector, as set by {@link #setSelector(Intent)}.
9335 * <p>For example, consider Intent A with {data="foo", categories="bar"}
9336 * and Intent B with {action="gotit", data-type="some/thing",
9339 * <p>Calling A.fillIn(B, Intent.FILL_IN_DATA) will result in A now
9343 * @param other Another Intent whose values are to be used to fill in
9354 public int fillIn(@NonNull Intent other, @FillInFlags int flags) {
9389 mSelector = new Intent(other.mSelector);
9430 Log.w("Intent", "Failure filling in extras", e);
9441 * Wrapper class holding an Intent and implementing comparisons on it for
9444 * simple calls to {@link Intent#filterEquals(Intent)} filterEquals()} and
9445 * {@link android.content.Intent#filterHashCode()} filterHashCode()}
9446 * on the wrapped Intent.
9449 private final Intent mIntent;
9452 public FilterComparison(Intent intent) {
9458 * Return the Intent that this FilterComparison represents.
9459 * @return Returns the Intent held by the FilterComparison. Do
9462 public Intent getIntent() {
9469 Intent other = ((FilterComparison)obj).mIntent;
9487 * @param other The other Intent to compare against.
9492 public boolean filterEquals(Intent other) {
9541 b.append("Intent { ");
9552 b.append("Intent { ");
9563 b.append("Intent { ");
9750 * Convert this Intent into a String holding a URI representation of it.
9753 * Intent's data as the base URI, with an additional fragment describing
9756 * <p>You can convert the returned string back to an Intent with
9762 * of the Intent.
9769 "Intent must include an explicit package name to build an android-app: "
9801 toUriFragment(uri, null, scheme == null ? Intent.ACTION_MAIN : Intent.ACTION_VIEW,
9834 toUriFragment(uri, scheme, Intent.ACTION_VIEW, null, flags);
9854 uri.append("#Intent;");
9964 public static final Parcelable.Creator<Intent> CREATOR
9965 = new Parcelable.Creator<Intent>() {
9966 public Intent createFromParcel(Parcel in) {
9967 return new Intent(in);
9969 public Intent[] newArray(int size) {
9970 return new Intent[size];
9975 protected Intent(Parcel in) {
10003 mSelector = new Intent(in);
10015 * an Intent object. The given XML parser should be located at the tag
10027 * @return An Intent object matching the XML data.
10031 public static @NonNull Intent parseIntent(@NonNull Resources resources,
10034 Intent intent = new Intent();
10037 com.android.internal.R.styleable.Intent);
10114 public static Intent restoreFromXml(XmlPullParser in) throws IOException,
10116 Intent intent = new Intent();
10134 Log.e("Intent", "restoreFromXml: unknown attribute=" + attrName);
10150 Log.w("Intent", "restoreFromXml: unknown name=" + name);
10172 * be normalized before they are used to create an Intent.
10194 * Prepare this {@link Intent} to leave an app process.
10205 * Prepare this {@link Intent} to leave an app process.
10220 final Object intent = mExtras.get(Intent.EXTRA_INTENT);
10221 if (intent instanceof Intent) {
10222 ((Intent) intent).prepareToLeaveProcess(leavingPackage);
10247 mData.checkFileUriExposed("Intent.getData()");
10259 mData.checkContentUriWithoutPermission("Intent.getData()", getFlags());
10365 final Intent intent = getParcelableExtra(EXTRA_INTENT);
10375 final Intent intent = (Intent) intents[i];