PackageManager.GetLaunchIntentForPackage(String) 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 a "good" intent to launch a front-door activity in a package.
[Android.Runtime.Register("getLaunchIntentForPackage", "(Ljava/lang/String;)Landroid/content/Intent;", "GetGetLaunchIntentForPackage_Ljava_lang_String_Handler")]
public abstract Android.Content.Intent? GetLaunchIntentForPackage (string packageName);
[<Android.Runtime.Register("getLaunchIntentForPackage", "(Ljava/lang/String;)Landroid/content/Intent;", "GetGetLaunchIntentForPackage_Ljava_lang_String_Handler")>]
abstract member GetLaunchIntentForPackage : string -> Android.Content.Intent
Parameters
- packageName
- String
The name of the package to inspect.
Returns
A fully-qualified Intent
that can be used to launch the
main activity in the package. Returns null
if the package
does not contain such an activity, or if <em>packageName</em> is not
recognized.
- Attributes
Remarks
Returns a "good" intent to launch a front-door activity in a package. This is used, for example, to implement an "open" button when browsing through packages. The current implementation looks first for a main activity in the category Intent#CATEGORY_INFO
, and next for a main activity in the category Intent#CATEGORY_LAUNCHER
. Returns null
if neither are found.
Consider using #getLaunchIntentSenderForPackage(String)
if the caller is not allowed to query for the packageName
.
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.