PreferenceDataStoreFile
public final class PreferenceDataStoreFile
Summary
Public methods |
|
---|---|
static final @NonNull File |
preferencesDataStoreFile(@NonNull Context receiver, @NonNull String name) Generate the File object for Preferences DataStore based on the provided context and name. |
Public methods
preferencesDataStoreFile
public static final @NonNull File preferencesDataStoreFile(@NonNull Context receiver, @NonNull String name)
Generate the File object for Preferences DataStore based on the provided context and name. The file is in the this.applicationContext.filesDir
+ "datastore/" subdirectory with name
. This is public to allow for testing and backwards compatibility (e.g. if moving from the preferencesDataStore
delegate or context.createDataStore to PreferencesDataStoreFactory).
Do NOT use the file outside of DataStore.
the context of the application used to get the files directory
the name of the preferences