public final class SharedPreferencesPolicy extends Object
SharedPreferences.| Modifier and Type | Class and Description |
|---|---|
static interface |
SharedPreferencesPolicy.FileMode
Defines an annotation for determining allowed file creation modes for
SharedPreferences
file. |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PREFERENCES_NAME_SUFFIX
Suffix for default name used by the Android for shared preferences.
|
static int |
FILE_MODE_APPEND
Copied flag from
Context.MODE_APPEND. |
static int |
FILE_MODE_PRIVATE
Copied flag from
Context.MODE_PRIVATE. |
| Modifier and Type | Method and Description |
|---|---|
static String |
defaultPreferencesName(android.content.Context context)
Creates a default name for shared preferences for the specified context that is
the same one as created by default by the Android framework.
|
static String |
preferencesName(android.content.Context context,
String nameSuffix)
Creates a name for shared preferences with the given nameSuffix for the specified
context.
|
public static final String DEFAULT_PREFERENCES_NAME_SUFFIX
public static final int FILE_MODE_PRIVATE
Context.MODE_PRIVATE.public static final int FILE_MODE_APPEND
Context.MODE_APPEND.public static String defaultPreferencesName(android.content.Context context)
context - The context for which to create preferences name.Context.getSharedPreferences(String, int).preferencesName(Context, String),
PreferenceManager.getDefaultSharedPreferencesName(Context)public static String preferencesName(android.content.Context context, String nameSuffix)
context - The context for which to create preferences name.nameSuffix - Suffix to be added into preferences name.Context.getSharedPreferences(String, int).defaultPreferencesName(Context)