@Retention(value=CLASS) @Target(value=METHOD) public @interface DefaultStringSet
Use on methods in SharedPref annotated class to specified the default
value of this preference.
The annotation value must be a String[]. The generated method
will return a Set<String> containing the values
of the given array.
The key of the preference will be the method name by default. This can be
overridden by specifying a string resource with the keyRes()
parameter.
Implementation note:
Since SharedPreferences.getStringSet is only available from API 11,
the generated method serializes the Set<String> into a String
, and persists it with
SharedPreferences.Editor#putString(String, String) using API 10 and below.
From API 11 and up, the generated method simply uses the native
SharedPreferences
Set<String> methods.
| Modifier and Type | Required Element and Description |
|---|---|
String[] |
value
The default value of the preference.
|
| Modifier and Type | Optional Element and Description |
|---|---|
int |
keyRes
The R.string.* field which refers to the key of the preference.
|
public abstract String[] value
Copyright © 2010–2020 simpligility technologies inc.. All rights reserved.