語言

IntentFilter.Create(String, String) 方法

定義

建立一個新的 IntentFilter 實例,設定指定的動作和 MIME 類型,並且你知道 MIME 類型格式正確。

[Android.Runtime.Register("create", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/IntentFilter;", "")]
public static Android.Content.IntentFilter? Create(string? action, string? dataType);
[<Android.Runtime.Register("create", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/IntentFilter;", "")>]
static member Create : string * string -> Android.Content.IntentFilter

參數

action
String

動作也要配合,例如Intent.ACTION_VIEW。

dataType
String

要用相應的類型,例如「vnd.android.cursor.dir/person」。

傳回

為該動作和類型新增一個 IntentFilter。

屬性

備註

建立一個新的 IntentFilter 實例,設定指定的動作和 MIME 類型,並且你知道 MIME 類型格式正確。 這會捕捉 MalformedMimeTypeException 建構子能呼叫的例外,並將其轉為執行時例外。

Java 文件 android.content.IntentFilter.create(java.lang.String, java.lang.String)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

另請參閱

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