Created
April 1, 2018 04:02
-
-
Save quangctkm9207/736f79169bc9ba73e12c335ed41123cd to your computer and use it in GitHub Desktop.
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 { | |
@BindPref(R.string.pref_name_key) | |
EditTextPreference namePreference; | |
@Override public void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
namePreference.setSummary("Uwoah! A summary."); | |
} | |
@OnPrefClick(R.string.pref_name_key) | |
void onNameClick(Preference preference) { | |
// Do anything you want | |
} | |
@OnPrefChange(R.string.pref_name_key) | |
void onNameChange(Preference preference, Object newValue) { | |
// Again, do anything you want | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment