Język

MockContext.CreatePackageContext(String, PackageContextFlags) Method

Definition

Return a new Context object for the given application name.

[Android.Runtime.Register("createPackageContext", "(Ljava/lang/String;I)Landroid/content/Context;", "GetCreatePackageContext_Ljava_lang_String_IHandler")]
public override Android.Content.Context? CreatePackageContext(string? packageName, Android.Content.PackageContextFlags flags);
[<Android.Runtime.Register("createPackageContext", "(Ljava/lang/String;I)Landroid/content/Context;", "GetCreatePackageContext_Ljava_lang_String_IHandler")>]
override this.CreatePackageContext : string * Android.Content.PackageContextFlags -> Android.Content.Context

Parameters

packageName
String

Name of the application's package.

Returns

No value is returned. The default mock implementation throws UnsupportedOperationException; override this method to supply a test result.

Attributes

Exceptions

Not thrown by the default mock implementation, which throws UnsupportedOperationException instead. A test override can supply its own behavior.

Remarks

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