Back to project page android-data-persistence.
The source code is released under:
MIT License
If you think the Android project android-data-persistence 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 com.teamtreehouse.mememaker; // w ww . jav a 2 s . c om import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.teamtreehouse.mememaker.utils.StorageType; /** * Created by Evan Anger on 8/13/14. */ public class MemeMakerApplicationSettings { SharedPreferences mSharedPreferences; public MemeMakerApplicationSettings(Context context) { mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); } public String getStoragePreference() { return mSharedPreferences.getString("Storage", StorageType.INTERNAL); } public void setSharedPreference(String storageType) { mSharedPreferences .edit() .putString("Storage", storageType) .apply(); } }