admin
2022-04-29 67bdeebb4dc381a2f46f31e3027ebcc3243a8aeb
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
30
31
32
33
34
package com.yeshi.makemoney.video.app.utils.videos;
 
import android.content.Context;
import android.content.SharedPreferences;
 
public class NovelGoldCornUtil {
 
 
    /**
     * 获取小说阅读时间
     *
     * @param context
     * @return
     */
    public static long getReadTime(Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("novel_goldcorn", Context.MODE_PRIVATE);
        return sharedPreferences.getLong("duration", 0L);
    }
 
    /**
     * 设置小说阅读时间
     *
     * @param duration
     * @param context
     */
    public static void setReadTime(long duration, Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("news_goldcorn", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putLong("duration", duration);
        editor.commit();
    }
 
 
}