MockContext.CreatePackageContext(String, PackageContextFlags) 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.
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.
- flags
- PackageContextFlags
Option flags, one of Android.Content.Context.CONTEXT_INCLUDE_CODE or Android.Content.Context.CONTEXT_IGNORE_SECURITY.
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.