Code example for SharedPreferences

Methods: unregisterOnSharedPreferenceChangeListener

0
        delegate.registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
    } 
 
    @Override 
    public void unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener onSharedPreferenceChangeListener) {
        delegate.unregisterOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
    } 
 
 
 
 
    protected String encrypt( String value ) {
 
        try { 
            final byte[] bytes = value!=null ? value.getBytes(UTF8) : new byte[0];
            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
            SecretKey key = keyFactory.generateSecret(new PBEKeySpec((StoreConfig.SOOM_SEC + SoomlaApp.getAppContext().getPackageName() + Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)).toCharArray()));
            Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
            pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(Settings.Secure.getString(context.getContentResolver(),Settings.Secure.ANDROID_ID).getBytes(UTF8), 20));
            return new String(Base64.encode(pbeCipher.doFinal(bytes), Base64.NO_WRAP),UTF8);
Contextual code suggestions in your IDE  Get Codota for Java