PackageManager.QueryIntentActivityOptions 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| 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) 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
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项;如果没有活动保留,则为空列表。 这不是错误注册重载的结果保证。
- 特性
注解
绑定限制:在 Android 37.2.31 .NET中,此重载注册Java列表和整数标志参数。 Android 改为使用 PackageManager.ResolveInfoFlags 对象声明其列表重载。 生成的绑定直接传递整数;它不构造标记对象。 此缺陷在 dotnet/android#13576 中跟踪。
参数和结果说明记录了预期的 Android 查询,而不是通过此不正确的注册成功调用。 它们不建立每个接收方或特定于应用程序的 JNI 重新映射的行为。
预期查询首先按输入顺序放置已解析的特定意向,然后保留剩余的常规结果。 特定 null 列表省略特定选项。 非 null 调用方请求从结果中删除匹配活动。