LauncherApps.GetAppMarketActivityIntent(String, UserHandle) 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.
Returns an intent sender which can be used to start the App Market activity (Installer Activity).
[Android.Runtime.Register("getAppMarketActivityIntent", "(Ljava/lang/String;Landroid/os/UserHandle;)Landroid/content/IntentSender;", "GetGetAppMarketActivityIntent_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=35)]
public virtual Android.Content.IntentSender? GetAppMarketActivityIntent (string? packageName, Android.OS.UserHandle user);
[<Android.Runtime.Register("getAppMarketActivityIntent", "(Ljava/lang/String;Landroid/os/UserHandle;)Landroid/content/IntentSender;", "GetGetAppMarketActivityIntent_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=35)>]
abstract member GetAppMarketActivityIntent : string * Android.OS.UserHandle -> Android.Content.IntentSender
override this.GetAppMarketActivityIntent : string * Android.OS.UserHandle -> Android.Content.IntentSender
Parameters
- packageName
- String
the package for which intent sender to launch App Market Activity is required.
- user
- UserHandle
the profile for which intent sender to launch App Market Activity is required.
Returns
IntentSender
object which launches the App Market Activity, null in case
there is no such activity.
- Attributes
Remarks
Returns an intent sender which can be used to start the App Market activity (Installer Activity). This method is primarily used to get an intent sender which starts App Market activity for another profile, if the caller is not otherwise allowed to start activity in that profile.
When packageName is set, intent sender to start the App Market Activity which installed the package in calling user will be returned, but for the profile passed.
When packageName is not set, intent sender to launch the default App Market Activity for the profile will be returned. In case there are multiple App Market Activities available for the profile, IntentPicker will be started, allowing user to choose the preferred activity.
The method will fall back to the behaviour of not having the packageName set, in case: <ul> <li>No activity for the packageName is found in calling user-space.</li> <li>The App Market Activity which installed the package in calling user-space is not present.</li> <li>The App Market Activity which installed the package in calling user-space is not present in the profile passed.</li> </ul>
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.