Created
January 22, 2018 02:10
maps duration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package putuguna.com.mapsnomatrix; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.preference.PreferenceManager; | |
/** | |
* Created by putuguna on 5/14/2016. | |
*/ | |
public class Utils { | |
public static String getStrings(Context ctx, String key) { | |
SharedPreferences sharedPreferences = PreferenceManager | |
.getDefaultSharedPreferences(ctx); | |
String value = sharedPreferences.getString( | |
key, null); | |
return value; | |
} | |
//save string | |
public static void saveString(Context context, String key, String value){ | |
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); | |
SharedPreferences.Editor edit = sharedPreferences.edit(); | |
edit.putString(key, value); | |
edit.commit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment