Back to project page LyricHere.
The source code is released under:
Apache License
If you think the Android project LyricHere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package cn.zhaiyifan.lyrichere.prefs; // w w w . j a va 2 s. c o m import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.os.Bundle; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import cn.zhaiyifan.lyrichere.R; public class SettingsFragment extends PreferenceFragment implements OnSharedPreferenceChangeListener { private SharedPreferences prefs; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preference); } @Override public void onStart() { super.onStart(); prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); prefs.registerOnSharedPreferenceChangeListener(this); } /** * Called when a shared preference is changed, added, or removed. This * may be called even if a preference is set to its existing value. * <p/> * <p>This callback will be run on your main thread. * * @param sharedPreferences The {@link android.content.SharedPreferences} that received * the change. * @param key The key of the preference that was changed, added, or */ @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { } }