admin
2021-02-03 1981dee5aec45793d3c4ebdbc4e637528c71b3c5
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
29
package com.weikou.beibeivideo.util;
 
import android.content.Context;
import android.content.SharedPreferences;
 
public class ConfigUtil {
 
    public static void saveVipLink(Context context, String link) {
        saveConfig("vipLink", link, context);
    }
 
    public static String getVipLink(Context context) {
        return getConfig("vipLink", context);
    }
 
    private static void saveConfig(String key, String value, Context context) {
        SharedPreferences.Editor editor = context.getSharedPreferences("config", Context.MODE_PRIVATE).edit();
        editor.putString(key, value);
        editor.commit();
    }
 
 
    private static String getConfig(String key, Context context) {
        SharedPreferences share = context.getSharedPreferences("config", Context.MODE_PRIVATE);
        return share.getString(key, "");
    }
 
 
}