Sdílet prostřednictvím


Intent.SetData(Uri) Method

Definition

Set the data this intent is operating on.

[Android.Runtime.Register("setData", "(Landroid/net/Uri;)Landroid/content/Intent;", "GetSetData_Landroid_net_Uri_Handler")]
public virtual Android.Content.Intent SetData (Android.Net.Uri? data);
[<Android.Runtime.Register("setData", "(Landroid/net/Uri;)Landroid/content/Intent;", "GetSetData_Landroid_net_Uri_Handler")>]
abstract member SetData : Android.Net.Uri -> Android.Content.Intent
override this.SetData : Android.Net.Uri -> Android.Content.Intent

Parameters

data
Uri

The Uri of the data this intent is now targeting.

Returns

Returns the same Intent object, for chaining multiple calls into a single statement.

Attributes

Remarks

Set the data this intent is operating on. This method automatically clears any type that was previously set by #setType or #setTypeAndNormalize.

<em>Note: scheme matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always write your Uri with a lower case scheme, or use Uri#normalizeScheme or #setDataAndNormalize to ensure that the scheme is converted to lower case.</em>

Java documentation for android.content.Intent.setData(android.net.Uri).

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

See also