Intent.NormalizeMimeType(String) Method

Definition

Normalize a MIME data type.

[Android.Runtime.Register("normalizeMimeType", "(Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? NormalizeMimeType (string? type);
[<Android.Runtime.Register("normalizeMimeType", "(Ljava/lang/String;)Ljava/lang/String;", "")>]
static member NormalizeMimeType : string -> string

Parameters

type
String

MIME data type to normalize

Returns

normalized MIME data type, or null if the input was null

Attributes

Remarks

Normalize a MIME data type.

A normalized MIME type has white-space trimmed, content-type parameters removed, and is lower-case. This aligns the type with Android best practices for intent filtering.

For example, "text/plain; charset=utf-8" becomes "text/plain". "text/x-vCard" becomes "text/x-vcard".

All MIME types received from outside Android (such as user input, or external sources like Bluetooth, NFC, or the Internet) should be normalized before they are used to create an Intent.

Java documentation for android.content.Intent.normalizeMimeType(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