ApplicationProvider
Artifact: androidx.test:core
public final class ApplicationProvider
Provides ability to retrieve the current application Context in tests.
This can be useful if you need to access the application assets (eg getApplicationContext().getAssets()), preferences (eg getApplicationContext().getSharedPreferences()), file system (eg getApplicationContext().getDir()) or one of the many other context APIs in test.
Summary
Public methods |
|
|---|---|
static T |
<T extends Context> getApplicationContext()Returns the application |
Public methods
getApplicationContext
public static T <T extends Context> getApplicationContext()
Returns the application android.content.Context for the application under test.
| See also | |
|---|---|
getApplicationContext |