@Retention(value=CLASS) @Target(value=METHOD) public @interface AfterPreferences
Methods annotated with AfterPreferences will be called after
addPreferenceFromResource is called by the generated classs.
This occurs AFTER addPreferencesFromResource which is called at
the end of super.onCreate(). Any preference depending code should be done in
an AfterPreferences annotated method.
This annotation only can be used inside
EActivity or
EFragment annotated
class, which is a subclass of PreferenceActivity or PreferenceFragment(Compat), respectively.
The method MUST have zero parameters.
There MAY be several methods annotated with AfterPreferences in the
same class.
Example :
@EActivity
public class SettingsActivity extends PreferenceActivity {
@PreferenceByKey(R.string.checkBoxPref)
CheckBoxPreference checkBoxPref;
@AfterPreferences
void initPrefs() {
checkBoxPref.setChecked(false);
}
}
Copyright © 2010–2016 simpligility technologies inc.. All rights reserved.