Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

ApplicationProvider

public final class ApplicationProvider
extends Object

java.lang.Object
   ↳ androidx.test.core.app.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 extends Context> T getApplicationContext()

Returns the application Context for the application under test.

Inherited methods

From class java.lang.Object

Public methods

getApplicationContext

T getApplicationContext ()

Returns the application Context for the application under test.

Returns
T