CrossProfileApps.StartMainActivity 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| StartMainActivity(ComponentName, UserHandle) |
在指定的配置文件中启动调用方包的指定主活动。 |
| StartMainActivity(ComponentName, UserHandle, Activity, Bundle) |
在指定的配置文件中启动调用方包的指定主活动,并在指定活动中启动。 |
StartMainActivity(ComponentName, UserHandle)
在指定的配置文件中启动调用方包的指定主活动。
[Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler", ApiSince=28)]
public virtual void StartMainActivity(Android.Content.ComponentName component, Android.OS.UserHandle targetUser);
[<Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler", ApiSince=28)>]
abstract member StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle -> unit
override this.StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle -> unit
参数
- component
- ComponentName
要启动的活动的 ComponentName,必须导出并具有操作 android.content.Intent#ACTION_MAIN、类别 android.content.Intent#CATEGORY_LAUNCHER。 否则,将引发 SecurityException。
- targetUser
- UserHandle
配置文件的 UserHandle 必须是返回 #getTargetUserProfiles()的用户之一,否则将引发 a SecurityException 。
- 特性
注解
在指定的配置文件中启动调用方包的指定主活动。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
StartMainActivity(ComponentName, UserHandle, Activity, Bundle)
在指定的配置文件中启动调用方包的指定主活动,并在指定活动中启动。
[Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;Landroid/app/Activity;Landroid/os/Bundle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Landroid_app_Activity_Landroid_os_Bundle_Handler", ApiSince=33)]
public virtual void StartMainActivity(Android.Content.ComponentName component, Android.OS.UserHandle targetUser, Android.App.Activity? callingActivity, Android.OS.Bundle? options);
[<Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;Landroid/app/Activity;Landroid/os/Bundle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Landroid_app_Activity_Landroid_os_Bundle_Handler", ApiSince=33)>]
abstract member StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle * Android.App.Activity * Android.OS.Bundle -> unit
override this.StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle * Android.App.Activity * Android.OS.Bundle -> unit
参数
- component
- ComponentName
要启动的活动的 ComponentName,必须导出并具有操作 android.content.Intent#ACTION_MAIN、类别 android.content.Intent#CATEGORY_LAUNCHER。 否则,将引发 SecurityException。
- targetUser
- UserHandle
配置文件的 UserHandle 必须是返回 #getTargetUserProfiles()的用户之一,否则将引发 a SecurityException 。
- callingActivity
- Activity
要从中启动新活动的活动,用于确定新活动应属于哪些任务。 如果 null,活动将始终在新任务中启动。
- options
- Bundle
活动选项或 null。 请参阅 android.app.ActivityOptions。
- 特性
注解
在指定的配置文件中启动调用方包的指定主活动,并在指定活动中启动。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。