From 4231c68cdcfed8abd29a76975022957c76994768 Mon Sep 17 00:00:00 2001 From: mazengfei <331023091@qq.com> Date: Fri, 7 Nov 2025 15:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/sw/plate/utils/PrefUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib_face/src/main/java/com/sw/plate/utils/PrefUtils.java b/lib_face/src/main/java/com/sw/plate/utils/PrefUtils.java index 946b0ad..d57c1d7 100644 --- a/lib_face/src/main/java/com/sw/plate/utils/PrefUtils.java +++ b/lib_face/src/main/java/com/sw/plate/utils/PrefUtils.java @@ -44,6 +44,18 @@ public class PrefUtils { sp.edit().putInt(key, value).commit(); } + public static long getLong(Context ctx, String key, long defaultValue) { + SharedPreferences sp = ctx.getSharedPreferences(PREF_NAME, + Context.MODE_PRIVATE); + return sp.getLong(key, defaultValue); + } + + public static void setLong(Context ctx, String key, long value) { + SharedPreferences sp = ctx.getSharedPreferences(PREF_NAME, + Context.MODE_PRIVATE); + sp.edit().putLong(key, value).commit(); + } + public static float getFloat(Context ctx, String key, float defaultValue) { SharedPreferences sp = ctx.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);