共用方式為


PackageInstaller.SessionParams.SetAppPackageName(String) Method

Definition

Optionally set the package name of the app being installed.

[Android.Runtime.Register("setAppPackageName", "(Ljava/lang/String;)V", "GetSetAppPackageName_Ljava_lang_String_Handler")]
public virtual void SetAppPackageName (string? appPackageName);
[<Android.Runtime.Register("setAppPackageName", "(Ljava/lang/String;)V", "GetSetAppPackageName_Ljava_lang_String_Handler")>]
abstract member SetAppPackageName : string -> unit
override this.SetAppPackageName : string -> unit

Parameters

appPackageName
String
Attributes

Remarks

Optionally set the package name of the app being installed. It's strongly recommended that you provide this value when known, so that observers can communicate installing apps to users.

If the APKs staged in the session aren't consistent with this package name, the install will fail. Regardless of this value, all APKs in the app must have the same package name.

Java documentation for android.content.pm.PackageInstaller.SessionParams.setAppPackageName(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