Udostępnij za pośrednictwem


Intent.SetPackage(String) Method

Definition

(Usually optional) Set an explicit application package name that limits the components this Intent will resolve to.

[Android.Runtime.Register("setPackage", "(Ljava/lang/String;)Landroid/content/Intent;", "GetSetPackage_Ljava_lang_String_Handler")]
public virtual Android.Content.Intent SetPackage (string? packageName);
[<Android.Runtime.Register("setPackage", "(Ljava/lang/String;)Landroid/content/Intent;", "GetSetPackage_Ljava_lang_String_Handler")>]
abstract member SetPackage : string -> Android.Content.Intent
override this.SetPackage : string -> Android.Content.Intent

Parameters

packageName
String

The name of the application package to handle the intent, or null to allow any application package.

Returns

Returns the same Intent object, for chaining multiple calls into a single statement.

Attributes

Remarks

(Usually optional) Set an explicit application package name that limits the components this Intent will resolve to. If left to the default value of null, all components in all applications will considered. If non-null, the Intent can only match the components in the given application package.

Java documentation for android.content.Intent.setPackage(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

See also