Intent.SetDataAndTypeAndNormalize(Uri, String) Method

Definition

(Usually optional) Normalize and set both the data Uri and an explicit MIME data type.

[Android.Runtime.Register("setDataAndTypeAndNormalize", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;", "GetSetDataAndTypeAndNormalize_Landroid_net_Uri_Ljava_lang_String_Handler")]
public virtual Android.Content.Intent SetDataAndTypeAndNormalize (Android.Net.Uri data, string? type);
[<Android.Runtime.Register("setDataAndTypeAndNormalize", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;", "GetSetDataAndTypeAndNormalize_Landroid_net_Uri_Ljava_lang_String_Handler")>]
abstract member SetDataAndTypeAndNormalize : Android.Net.Uri * string -> Android.Content.Intent
override this.SetDataAndTypeAndNormalize : Android.Net.Uri * string -> Android.Content.Intent

Parameters

data
Uri

The Uri of the data this intent is now targeting.

type
String

The MIME type of the data being handled by this intent.

Returns

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

Attributes

Remarks

(Usually optional) Normalize and set both the data Uri and an explicit MIME data type. This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here.

The data Uri and the MIME type are normalize using android.net.Uri#normalizeScheme and #normalizeMimeType before they are set, so really this is just a convenience method for

setDataAndType(data.normalize(), Intent.normalizeMimeType(type))

Java documentation for android.content.Intent.setDataAndTypeAndNormalize(android.net.Uri, java.lang.String).

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