public static void init(Context context){
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  prefs.registerOnSharedPreferenceChangeListener(null);
}

public static void init ( Context context ) { SharedPreferences prefs = PreferenceManager . getDefaultSharedPreferences ( context ) ; prefs . registerOnSharedPreferenceChangeListener ( null ) ; }
initialize preferences and register a listener for changes
