Last active
April 1, 2018 04:02
-
-
Save quangctkm9207/128fdeee1d107f2382431f36f392584f to your computer and use it in GitHub Desktop.
Java Reflection and Annotation Processing: http://emo-pass.com/2017/11/26/builing-things-with-java-reflection-and-annotation-processing/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SettingsFragment extends PreferenceFragment { | |
EditTextPreference namePreference; | |
@Override public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
namePreference = (EditTextPreference) findPreference(getString(R.string.pref_name_key)); | |
namePreference.setSummary("Uwoah! A summary."); | |
namePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { | |
@Override public boolean onPreferenceClick(Preference preference) { | |
// Do anything you want | |
return true; | |
} | |
}); | |
namePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { | |
@Override public boolean onPreferenceChange(Preference preference, Object newValue) { | |
// Again, do anything you want | |
return true; | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment