Blame view

C5/app/src/main/java/com/sunvote/xpadapp/utils/CacheData.java 879 Bytes
fac86401   孙向锦   初始化C5 Vote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  package com.sunvote.xpadapp.utils;
  
  import android.content.Context;
  import android.content.SharedPreferences;
  import android.content.SharedPreferences.Editor;
  
  
  
  public class CacheData {
  	private static SharedPreferences sp;  
      
      @SuppressWarnings("static-access")  
      public static void SetData(Context context, String filename, String key,  
              String value) {  
          sp = context.getSharedPreferences(filename, context.MODE_PRIVATE);  
          Editor editor = sp.edit();  
          editor.putString(key, value);  
          editor.commit();  
      }  
    
      @SuppressWarnings("static-access")  
      public static String GetData(Context context, String filename, String key) {  
          String value = "";  
          sp = context.getSharedPreferences(filename, context.MODE_PRIVATE);  
          value = sp.getString(key, "");  
          return value;  
      }  
  }