LauncherApps.StartMainActivity Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts a Main activity in the specified profile.
[Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;Landroid/graphics/Rect;Landroid/os/Bundle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Landroid_graphics_Rect_Landroid_os_Bundle_Handler")]
public virtual void StartMainActivity (Android.Content.ComponentName? component, Android.OS.UserHandle? user, Android.Graphics.Rect? sourceBounds, Android.OS.Bundle? opts);
[<Android.Runtime.Register("startMainActivity", "(Landroid/content/ComponentName;Landroid/os/UserHandle;Landroid/graphics/Rect;Landroid/os/Bundle;)V", "GetStartMainActivity_Landroid_content_ComponentName_Landroid_os_UserHandle_Landroid_graphics_Rect_Landroid_os_Bundle_Handler")>]
abstract member StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle * Android.Graphics.Rect * Android.OS.Bundle -> unit
override this.StartMainActivity : Android.Content.ComponentName * Android.OS.UserHandle * Android.Graphics.Rect * Android.OS.Bundle -> unit
Parameters
- component
- ComponentName
The ComponentName of the activity to launch
- user
- UserHandle
The UserHandle of the profile
- sourceBounds
- Rect
The Rect containing the source bounds of the clicked icon
- opts
- Bundle
Options to pass to startActivity
- Attributes
Remarks
Starts a Main activity in the specified profile.
If the user in question is a hidden profile UserManager.USER_TYPE_PROFILE_PRIVATE
, caller should have either:
<ul> <li>the privileged android.Manifest.permission.ACCESS_HIDDEN_PROFILES_FULL
permission</li> <li>the normal android.Manifest.permission.ACCESS_HIDDEN_PROFILES
permission and the android.app.role.RoleManager.ROLE_HOME
role. </li> </ul>
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.