Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. package com.example.submission1.utils;
  2.  
  3. import android.content.Context;
  4. import android.content.SharedPreferences;
  5. import android.preference.PreferenceManager;
  6.  
  7. public class SessionUtil {
  8.  
  9. private SharedPreferences sharedPreferences;
  10.  
  11. public SessionUtil(Context context) {
  12. if (context != null) {
  13. sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
  14. }
  15. }
  16.  
  17. public void setReleaseReminder(boolean status){
  18. sharedPreferences
  19. .edit()
  20. .putBoolean("release_reminder",status)
  21. .commit();
  22. }
  23.  
  24. public boolean getReleaseReminder(){
  25. return sharedPreferences.getBoolean("release_reminder",true);
  26. }
  27.  
  28. public void setDialyReminder(boolean status){
  29. sharedPreferences
  30. .edit()
  31. .putBoolean("dialy_reminder",status)
  32. .commit();
  33. }
  34.  
  35. public boolean getDialyReminder(){
  36. return sharedPreferences.getBoolean("dialy_reminder",true);
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement