共用方式為


Intent.FillIn(Intent, FillInFlags) Method

Definition

Copy the contents of <var>other</var> in to this object, but only where fields are not defined by this object.

[Android.Runtime.Register("fillIn", "(Landroid/content/Intent;I)I", "GetFillIn_Landroid_content_Intent_IHandler")]
public virtual Android.Content.FillInFlags FillIn (Android.Content.Intent other, Android.Content.FillInFlags flags);
[<Android.Runtime.Register("fillIn", "(Landroid/content/Intent;I)I", "GetFillIn_Landroid_content_Intent_IHandler")>]
abstract member FillIn : Android.Content.Intent * Android.Content.FillInFlags -> Android.Content.FillInFlags
override this.FillIn : Android.Content.Intent * Android.Content.FillInFlags -> Android.Content.FillInFlags

Parameters

other
Intent

Another Intent whose values are to be used to fill in the current one.

flags
FillInFlags

Options to control which fields can be filled in.

Returns

Returns a bit mask of #FILL_IN_ACTION, #FILL_IN_DATA, #FILL_IN_CATEGORIES, #FILL_IN_PACKAGE, #FILL_IN_COMPONENT, #FILL_IN_SOURCE_BOUNDS, #FILL_IN_SELECTOR and #FILL_IN_CLIP_DATA indicating which fields were changed.

Attributes

Remarks

Copy the contents of <var>other</var> in to this object, but only where fields are not defined by this object. For purposes of a field being defined, the following pieces of data in the Intent are considered to be separate fields:

<ul> <li> action, as set by #setAction. <li> data Uri and MIME type, as set by #setData(Uri), #setType(String), or #setDataAndType(Uri, String). <li> identifier, as set by #setIdentifier. <li> categories, as set by #addCategory. <li> package, as set by #setPackage. <li> component, as set by #setComponent(ComponentName) or related methods. <li> source bounds, as set by #setSourceBounds. <li> selector, as set by #setSelector(Intent). <li> clip data, as set by #setClipData(ClipData). <li> each top-level name in the associated extras. </ul>

In addition, you can use the #FILL_IN_ACTION, #FILL_IN_DATA, #FILL_IN_IDENTIFIER, #FILL_IN_CATEGORIES, #FILL_IN_PACKAGE, #FILL_IN_COMPONENT, #FILL_IN_SOURCE_BOUNDS, #FILL_IN_SELECTOR, and #FILL_IN_CLIP_DATA to override the restriction where the corresponding field will not be replaced if it is already set.

Note: The component field will only be copied if #FILL_IN_COMPONENT is explicitly specified. The selector will only be copied if #FILL_IN_SELECTOR is explicitly specified.

For example, consider Intent A with {data="foo", categories="bar"} and Intent B with {action="gotit", data-type="some/thing", categories="one","two"}.

Calling A.fillIn(B, Intent.FILL_IN_DATA) will result in A now containing: {action="gotit", data-type="some/thing", categories="bar"}.

Java documentation for android.content.Intent.fillIn(android.content.Intent, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to