@Retention(value=CLASS) @Target(value=METHOD) public @interface PreferenceClick
This annotation is intended to be used on methods to receive events defined
by OnPreferenceClickListener#onPreferenceClick(Preference) when
the Preference has been clicked by the user.
This annotation only can be used inside
EActivity or
EFragment annotated
class, which is a subclass of PreferenceActivity or PreferenceFragment(Compat), respectively.
The annotation value should be one or several of R.string.* fields. If not set, the method name will be used as the R.string.* field name.
The method MAY have one parameter:
Preference (or a subclass) or
android.support.v7.preference.Preference (or a subclass)
parameter to know which preference has been clicked
Example :
@PreferenceClick(R.string.myPref)
void clickOnMyPref() {
// Something Here
}
@PreferenceClick
void myPrefPreferenceClicked(Preference preference) {
// Something Here
}
@PreferenceClick
void myPrefPreferenceClicked(ListPreference preference) {
// Something Here
}
PreferenceChangepublic abstract int[] value
public abstract String[] resName
Copyright © 2010–2020 simpligility technologies inc.. All rights reserved.