IntentFilter.AddDataType(String) Method

Definition

Add a new Intent data type to match against.

[Android.Runtime.Register("addDataType", "(Ljava/lang/String;)V", "")]
public void AddDataType (string? type);
[<Android.Runtime.Register("addDataType", "(Ljava/lang/String;)V", "")>]
member this.AddDataType : string -> unit

Parameters

type
String

Name of the data type to match, such as "vnd.android.cursor.dir/person".

Attributes

Exceptions

Remarks

Add a new Intent data type to match against. If any types are included in the filter, then an Intent's data must be <em>either</em> one of these types <em>or</em> a matching scheme. If no data types are included, then an Intent will only match if it specifies no data.

<em>Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types. As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.</em>

Throws MalformedMimeTypeException if the given MIME type is not syntactically correct.

Java documentation for android.content.IntentFilter.addDataType(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

  • <xref:Android.Content.IntentFilter.MatchData(System.String%2c+System.String%2c+System.String)>