Share via


Instrumentation.TargetContext Property

Definition

Return a Context for the target application being instrumented.

public virtual Android.Content.Context? TargetContext { [Android.Runtime.Register("getTargetContext", "()Landroid/content/Context;", "GetGetTargetContextHandler")] get; }
[<get: Android.Runtime.Register("getTargetContext", "()Landroid/content/Context;", "GetGetTargetContextHandler")>]
member this.TargetContext : Android.Content.Context

Property Value

A Context in the target application.

Attributes

Remarks

Return a Context for the target application being instrumented. Note that this is often different than the Context of the instrumentation code, since the instrumentation code often lives is a different package than that of the application it is running against. See #getContext to retrieve a Context for the instrumentation code.

Java documentation for android.app.Instrumentation.getTargetContext().

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