语言

Intent.MakeMainSelectorActivity(String, String) 方法

定义

为应用程序的主要活动创建意向,而无需指定要运行的特定活动,但提供一个选择器来查找活动。

[Android.Runtime.Register("makeMainSelectorActivity", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;", "")]
public static Android.Content.Intent? MakeMainSelectorActivity(string? selectorAction, string? selectorCategory);
[<Android.Runtime.Register("makeMainSelectorActivity", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;", "")>]
static member MakeMainSelectorActivity : string * string -> Android.Content.Intent

参数

selectorAction
String

意向选择器的操作名称。

selectorCategory
String

要添加到意向选择器的类别的名称。

返回

返回一个新创建的意向,该意向可用于启动活动作为主应用程序条目。

特性

注解

为应用程序的主要活动创建意向,而无需指定要运行的特定活动,但提供一个选择器来查找活动。 这会导致最终意向的结构与从主页启动应用程序时相同。 对于想要以相同方式启动应用程序的任何其他内容,请务必使用采用相同方式构建的意向,并可以使用此函数来确保这种情况。

返回的意向具有 #ACTION_MAIN 其操作,并包括类别 #CATEGORY_LAUNCHER。 这未#FLAG_ACTIVITY_NEW_TASK设置,但通常需要在返回的意向上执行此操作#addFlags(int)。

Java文档android.content.Intent.makeMainSelectorActivity(java.lang.String, java.lang.String)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

另请参阅