Intent.SetIdentifier(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為此意圖設定識別碼。
[Android.Runtime.Register("setIdentifier", "(Ljava/lang/String;)Landroid/content/Intent;", "GetSetIdentifier_Ljava_lang_String_Handler", ApiSince=29)]
public virtual Android.Content.Intent SetIdentifier(string? identifier);
[<Android.Runtime.Register("setIdentifier", "(Ljava/lang/String;)Landroid/content/Intent;", "GetSetIdentifier_Ljava_lang_String_Handler", ApiSince=29)>]
abstract member SetIdentifier : string -> Android.Content.Intent
override this.SetIdentifier : string -> Android.Content.Intent
參數
- identifier
- String
這個意圖的識別碼。 字串的內容對系統沒有意義,除了它們是否與其他識別碼完全相同。
傳回
回傳相同的 Intent 物件,用於將多個呼叫串接成一個語句。
- 屬性
備註
為此意圖設定識別碼。 若設定為此意圖,則提供唯一身份,使其與其他本來看起來相同的意圖具有獨特性。 特別地,這將用來 #filterEquals(Intent) 判斷兩個意圖是否與其他欄位相同,如 #setAction。 然而,與這些欄位不同的是,識別碼為 <em never>/em<,用於與 a >匹配;這就像該識別碼尚未在IntentFilter意圖上設定。
例如,這可以用來使此意圖與其他相同意圖不同,從而 android.app.PendingIntent建立 。 (不過請注意,PendingIntent 的接收者會看到你輸入的任何內容。)這個字串的結構在平台上完全沒有定義,但如果你要在不同應用程式中暴露識別字串,且沒有中央單位定義這個欄位的內容,你可能需要自己定義結構。
Java 文件 android.content.Intent.setIdentifier(java.lang.String)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。