PackageManager.QueryIntentActivityOptions 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| QueryIntentActivityOptions(ComponentName, Intent[], Intent, PackageInfoFlags) |
取得一組活動,應該以類似選項呈現給使用者。 |
| QueryIntentActivityOptions(ComponentName, IList<Intent>, Intent, PackageInfoFlags) |
旨在尋找一般意圖及可選的特定意圖的活動選擇;此過載存在已知的 JNI 結合缺陷。 |
QueryIntentActivityOptions(ComponentName, Intent[], Intent, PackageInfoFlags)
取得一組活動,應該以類似選項呈現給使用者。
[Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_arrayLandroid_content_Intent_Landroid_content_Intent_IHandler")]
public abstract System.Collections.Generic.IList<Android.Content.PM.ResolveInfo> QueryIntentActivityOptions(Android.Content.ComponentName? caller, Android.Content.Intent[]? specifics, Android.Content.Intent intent, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_arrayLandroid_content_Intent_Landroid_content_Intent_IHandler")>]
abstract member QueryIntentActivityOptions : Android.Content.ComponentName * Android.Content.Intent[] * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
參數
- caller
- ComponentName
提出請求的活動類別名稱。 此活動永遠不會出現在輸出清單中。 可以是 null。
- specifics
- Intent[]
一組意圖,應該解決到最初的具體結果。 可以是 null。
- intent
- Intent
根據 resolveActivity() 所期望的意圖。
- flags
- PackageInfoFlags
新增選項旗標以修改回傳的資料。 最重要的是 #MATCH_DEFAULT_ONLY,限制解析範圍僅包含支持該活動 android.content.Intent#CATEGORY_DEFAULT的活動。
傳回
回傳一份包含每個匹配活動一個條目的 ResolveInfo 物件清單。 清單首先依據所有已 解決的意圖 排序,接著是任何能處理 意圖 但未被 特定 意圖納入的額外活動。 若無匹配活動,則回傳一個空清單。
- 屬性
備註
取得一組活動,應該以類似選項呈現給使用者。 這類似 #queryIntentActivities,但它也允許你提供一份更明確的意圖清單,想解析到特定選項,並根據這些輸入,合理順序回傳最終的 ResolveInfo 清單,避免重複。
需要長旗時使用 #queryIntentActivityOptions(ComponentName, List, Intent, ResolveInfoFlags) 。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
QueryIntentActivityOptions(ComponentName, IList<Intent>, Intent, PackageInfoFlags)
旨在尋找一般意圖及可選的特定意圖的活動選擇;此過載存在已知的 JNI 結合缺陷。
[Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;Ljava/util/List;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_Ljava_util_List_Landroid_content_Intent_IHandler", ApiSince=33)]
public virtual System.Collections.Generic.IList<Android.Content.PM.ResolveInfo> QueryIntentActivityOptions(Android.Content.ComponentName? caller, System.Collections.Generic.IList<Android.Content.Intent>? specifics, Android.Content.Intent intent, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("queryIntentActivityOptions", "(Landroid/content/ComponentName;Ljava/util/List;Landroid/content/Intent;I)Ljava/util/List;", "GetQueryIntentActivityOptions_Landroid_content_ComponentName_Ljava_util_List_Landroid_content_Intent_IHandler", ApiSince=33)>]
abstract member QueryIntentActivityOptions : Android.Content.ComponentName * System.Collections.Generic.IList<Android.Content.Intent> * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
override this.QueryIntentActivityOptions : Android.Content.ComponentName * System.Collections.Generic.IList<Android.Content.Intent> * Android.Content.Intent * Android.Content.PM.PackageInfoFlags -> System.Collections.Generic.IList<Android.Content.PM.ResolveInfo>
參數
- caller
- ComponentName
要從預期查詢結果中排除的活動元件,或 null 不排除呼叫者。
- intent
- Intent
用於尋找預期查詢中剩餘活動選項的一般意圖。
- flags
- PackageInfoFlags
目前繫結所傳遞的整數查詢選項。 預期的 Android 清單超載需要一個 PackageManager.ResolveInfoFlags 物件。
傳回
對於預期查詢,活動結果會顯示 , specifics 接著是剩餘的匹配 intent,若沒有活動剩餘,則為空清單。 這並非錯誤註冊超載的結果保證。
- 屬性
備註
綁定限制:在 .NET for Android 37.2.31 中,此重載會以 Java 清單及整數旗標參數註冊。 Android 則改用物件 PackageManager.ResolveInfoFlags 宣告其清單超載。 產生的綁定會直接傳遞整數;它不會建構該標記物件的物件。 這個缺陷在 dotnet/android#13576 中被追蹤。
參數與結果描述記錄的是預期的 Android 查詢,而非因錯誤註冊而成功呼叫的結果。 它們並不會確立每一個接收端或應用程式專屬 JNI 重新映射的行為。
預期的查詢會先依輸入順序放置已解決的特定意圖,然後保留其餘的一般結果。
null具體清單會省略具體選項。 非空呼叫者會要求從結果中移除匹配的活動。