Intent.SetComponent(ComponentName) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
(通常是自願的)明確設定元件來處理意圖。
[Android.Runtime.Register("setComponent", "(Landroid/content/ComponentName;)Landroid/content/Intent;", "GetSetComponent_Landroid_content_ComponentName_Handler")]
public virtual Android.Content.Intent SetComponent(Android.Content.ComponentName? component);
[<Android.Runtime.Register("setComponent", "(Landroid/content/ComponentName;)Landroid/content/Intent;", "GetSetComponent_Landroid_content_ComponentName_Handler")>]
abstract member SetComponent : Android.Content.ComponentName -> Android.Content.Intent
override this.SetComponent : Android.Content.ComponentName -> Android.Content.Intent
參數
- component
- ComponentName
用應用程式元件名稱來處理意圖,或是 null 讓系統幫你找到。
傳回
回傳相同的 Intent 物件,用於將多個呼叫串接成一個語句。
- 屬性
備註
(通常是自願的)明確設定元件來處理意圖。 若預設值為 null,系統會根據意圖中其他欄位(動作、資料、型別、類別)決定合適的類別。 若定義此類別,則無論其他欄位如何,指定的類別都會被使用。 只有當你確定一定要使用特定類別時,才應該設定這個數值;否則,最好讓系統自行尋找合適的類別,這樣你才能尊重已安裝的應用程式和使用者偏好。
Java 文件 android.content.Intent.setComponent(android.content.ComponentName)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
另請參閱
- <xref:Android.Content.Intent.SetClassName(Android.Content.Context%2c+System.String)>
- <xref:Android.Content.Intent.SetClassName(System.String%2c+System.String)>
- Component
- ResolveActivity(PackageManager)