SharedPreferences unregisterOnSharedPreferenceChangeListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SharedPreferences unregisterOnSharedPreferenceChangeListener method.

This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
	} 
 
	@Override 
	public void onDestroy() { 
		unsetAlarm(); 
		this.appSettings.unregisterOnSharedPreferenceChangeListener(this);
		super.onDestroy(); 
	} 
	 
	public static void stopAlarm(Context context) {
		Intent intent = new Intent(context, SyncService.class);
		intent.putExtra(ACTION, SyncService.STOP_ALARM);
		context.startService(intent);
	} 
 
	public static void startAlarm(Context context) {
		Intent intent = new Intent(context, SyncService.class);
		intent.putExtra(ACTION, SyncService.START_ALARM);
		context.startService(intent);
	} 
6
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
        if (mStateMachineEvent) return;
        mPrefs.edit().putBoolean(mKey, isChecked).commit();
    } 
 
    public void pause() { 
        mPrefs.unregisterOnSharedPreferenceChangeListener(this);
        mSwitch.setOnCheckedChangeListener(null);
    } 
 
    public void resume() { 
        mPrefs.registerOnSharedPreferenceChangeListener(this);
        setSwitchChecked(mPrefs.getBoolean(mKey, mDefValue));
        mSwitch.setOnCheckedChangeListener(this);
    } 
 
    @Override 
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
        if (key.equals(mKey)) {
            setSwitchChecked(sharedPreferences.getBoolean(mKey, mDefValue));
        } 
6
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
		setOrientation(); 
		mPrefs.registerOnSharedPreferenceChangeListener(this);
	} 
	 
	public void onPause() { 
		mPrefs.unregisterOnSharedPreferenceChangeListener(this);
	} 
	 
	public void onStop() {} 
	 
	public void onDestroy() {} 
 
	@Override 
	public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
		if(key.equals("orientation")) {
			setOrientation(); 
		} 
	} 
	 
	private void setOrientation() { 
6
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
	@Override 
	public void onPause() { 
		super.onPause(); 
		mConf.onPause();
		 
		mPrefs.unregisterOnSharedPreferenceChangeListener(this);
	} 
	 
	@Override 
	public void onStop() { 
		super.onStop(); 
		mConf.onStop();
	} 
	 
	@Override 
	public void onDestroy() { 
		super.onDestroy(); 
		mConf.onDestroy();
	} 
	 
5
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
 
    @Override 
    protected void onPause() { 
        super.onPause(); 
 
        sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);
    } 
 
    @Override 
    protected void onResume() { 
        super.onResume(); 
        sharedPreferences.registerOnSharedPreferenceChangeListener(this);
 
        hostPref.setSummary(sharedPreferences.getString("host", ""));
        portPref.setSummary(sharedPreferences.getString("port", "8001"));
        textSizePref.setSummary(sharedPreferences.getString("text_size", "10"));
        timestampformatPref.setSummary(sharedPreferences.getString("timestamp_format", "HH:mm:ss"));
        stunnelCert.setSummary(sharedPreferences.getString("stunnel_cert", "Not Set"));
 
        sshHostPref.setSummary(sharedPreferences.getString("ssh_host", ""));
5
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
 
	@Override 
	public void unregisterOnSharedPreferenceChangeListener( 
			OnSharedPreferenceChangeListener listener) {
		SecurePreferences.sFile
				.unregisterOnSharedPreferenceChangeListener(listener);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:unregisterOnSharedPreferenceChangeListener
	public void registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
		mPreferences.registerOnSharedPreferenceChangeListener(listener);
	} 
 
	public void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) {
		mPreferences.unregisterOnSharedPreferenceChangeListener(listener);
	} 
 
	public UserPreferencesEditor edit() { 
		return new UserPreferencesEditor(mPreferences.edit());
	} 
 
	public class UserPreferencesEditor { 
		private SharedPreferences.Editor mEditor;
 
		public UserPreferencesEditor(SharedPreferences.Editor editor) {
			mEditor = editor;
		} 
 
		public boolean commit() { 
5
CodeRank

Related SharedPreferences unregisterOnSharedPreferenceChangeListener Questions & Answers:

unregisterOnSharedPreferenceChangeListener Method Overview
Unregisters a previous callback.
See Code Examples for other Android SharedPreferences Methods: