public final class ContextInstrumenter extends Object
Contexts for test purposes. Activity classes may pass the base context
in ContextThemeWrapper.attachBaseContext(android.content.Context) to from(android.content.Context) to allow themselves to be
instrumented. This technique supports instrumentation tests and unit tests.| Modifier and Type | Class and Description |
|---|---|
static interface |
ContextInstrumenter.Provider
An provider of instrumented
Contexts. |
public static Context from(Context context)
context - the Context to instrument.Context or context itself if a ContextInstrumenter.Provider is
not configured.