Sdílet prostřednictvím


PackageManager.GetLaunchIntentSenderForPackage(String) Method

Definition

Returns an IntentSender that can be used to launch a front-door activity in a package.

[Android.Runtime.Register("getLaunchIntentSenderForPackage", "(Ljava/lang/String;)Landroid/content/IntentSender;", "GetGetLaunchIntentSenderForPackage_Ljava_lang_String_Handler", ApiSince=33)]
public virtual Android.Content.IntentSender GetLaunchIntentSenderForPackage (string packageName);
[<Android.Runtime.Register("getLaunchIntentSenderForPackage", "(Ljava/lang/String;)Landroid/content/IntentSender;", "GetGetLaunchIntentSenderForPackage_Ljava_lang_String_Handler", ApiSince=33)>]
abstract member GetLaunchIntentSenderForPackage : string -> Android.Content.IntentSender
override this.GetLaunchIntentSenderForPackage : string -> Android.Content.IntentSender

Parameters

packageName
String

The name of the package to inspect.

Returns

Returns a IntentSender to launch the activity.

Attributes

Remarks

Returns an IntentSender that can be used 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 is the same with #getLaunchIntentForPackage(String). Instead of returning the Intent, it returns the IntentSender which is not restricted by the package visibility.

The caller can invoke IntentSender#sendIntent(Context, int, Intent, IntentSender.OnFinished, Handler) to launch the activity. An IntentSender.SendIntentException is thrown if the package does not contain such an activity, or if <em>packageName</em> is not recognized.

Java documentation for android.content.pm.PackageManager.getLaunchIntentSenderForPackage(java.lang.String).

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.

Applies to