Code example for Application

Methods: getDefaultSharedPreferences

0
        SharedPreferences sharedPreferences;
        if (preferencesName != null) {
            sharedPreferences = application
                    .getSharedPreferences(preferencesName, Context.MODE_PRIVATE);
        } else { 
            sharedPreferences = PreferenceManager.getDefaultSharedPreferences(application);
        } 
 
        return new EncryptedSharedPreferences(application, sharedPreferences);
    } 
 
    public static class PreferencesNameHolder { 
 
        @Inject(optional = true) 
        @SharedPreferencesName 
        protected String value;
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE