NdefRecord.ToMimeType Method

Definition

Map this record to a MIME type, or return null if it cannot be mapped.

[Android.Runtime.Register("toMimeType", "()Ljava/lang/String;", "")]
public string? ToMimeType ();
[<Android.Runtime.Register("toMimeType", "()Ljava/lang/String;", "")>]
member this.ToMimeType : unit -> string

Returns

MIME type as a string, or null if this is not a MIME record

Attributes

Remarks

Map this record to a MIME type, or return null if it cannot be mapped.

Currently this method considers all #TNF_MIME_MEDIA records to be MIME records, as well as some #TNF_WELL_KNOWN records such as #RTD_TEXT. If this is a MIME record then the MIME type as string is returned, otherwise null is returned.

This method does not perform validation that the MIME type is actually valid. It always attempts to return a string containing the type if this is a MIME record.

The returned MIME type will by normalized to lower-case using Intent#normalizeMimeType.

The MIME payload can be obtained using #getPayload.

Java documentation for android.nfc.NdefRecord.toMimeType().

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