Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.submission1.utils;
- import android.content.Context;
- import android.content.SharedPreferences;
- import android.preference.PreferenceManager;
- public class SessionUtil {
- private SharedPreferences sharedPreferences;
- public SessionUtil(Context context) {
- if (context != null) {
- sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
- }
- }
- public void setReleaseReminder(boolean status){
- sharedPreferences
- .edit()
- .putBoolean("release_reminder",status)
- .commit();
- }
- public boolean getReleaseReminder(){
- return sharedPreferences.getBoolean("release_reminder",true);
- }
- public void setDialyReminder(boolean status){
- sharedPreferences
- .edit()
- .putBoolean("dialy_reminder",status)
- .commit();
- }
- public boolean getDialyReminder(){
- return sharedPreferences.getBoolean("dialy_reminder",true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement