|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={TYPE,FIELD}) @Retention(value=RUNTIME) @Inherited public @interface BindPreference
Annotation type to make a Preference
's value reflected in its summary field.
The format defaults to simply echoing the value of the selected Preference
, but can
be customized by specifying the format of the summary.
Echo value of preference
@BindPreference public static final String PREF_THOUSAND_SEPARATOR = "thousand_separator";Echo formatted value
@BindPreference(format="Delimiter: %s") public static final String PREF_THOUSAND_SEPARATOR = "thousand_separator";Echo formatted value and fire preference change event by key id
@BindPreference(format = "Delimiter: %s", fireChange = { PREF_DATE_FORMAT }) public static final String PREF_DATE_FORMAT_SEPARATOR = "date_format_separator";
Optional Element Summary | |
---|---|
java.lang.String[] |
fireChange
Each defined entry will fire a OnSharedPreferenceChangeListener#onSharedPreferenceChanged(SharedPreferences, String)
where the string parameter corresponds to the given entry in the array. |
java.lang.String |
format
Format string of summary. |
java.lang.String |
key
The key value associated with a preference. |
public abstract java.lang.String key
Preference.getKey()
public abstract java.lang.String format
public abstract java.lang.String[] fireChange
OnSharedPreferenceChangeListener#onSharedPreferenceChanged(SharedPreferences, String)
where the string parameter corresponds to the given entry in the array. This is
primarily useful if the formatted summary co-depends on a value given in a separate
preference. However, all such situations must be handled by the class extending
AnnotatedPreferenceActivity
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |