Commit b5815a8c by amateur

1

1 parent ec6a8cce
...@@ -7,7 +7,10 @@ public class SpUtils { ...@@ -7,7 +7,10 @@ public class SpUtils {
private static final String SP_NAME = "NAFMII"; private static final String SP_NAME = "NAFMII";
public static final String WEB_VERSION_KEY = "WEB_VERSION"; // 首次运行
public static final String KEY_FIRST_RUN = "FIRST_RUN";
// H5版本
public static final String KEY_H5_VERSION = "H5_VERSION";
public static void putBoolean(String key, boolean val) { public static void putBoolean(String key, boolean val) {
SharedPreferences.Editor edit = getSpMgr().edit(); SharedPreferences.Editor edit = getSpMgr().edit();
......
...@@ -7,11 +7,11 @@ import java.io.File; ...@@ -7,11 +7,11 @@ import java.io.File;
public class WebVersionUtils { public class WebVersionUtils {
public static String getVersion() { public static String getVersion() {
return SpUtils.getString(SpUtils.WEB_VERSION_KEY, BuildConfig.WEB_VERSION); return SpUtils.getString(SpUtils.KEY_H5_VERSION, BuildConfig.WEB_VERSION);
} }
public static void setVersion(String name) { public static void setVersion(String name) {
SpUtils.putString(SpUtils.WEB_VERSION_KEY, name); SpUtils.putString(SpUtils.KEY_H5_VERSION, name);
} }
public static File getIndex() { public static File getIndex() {
......
...@@ -108,7 +108,7 @@ public class MainActivity extends BaseActivity { ...@@ -108,7 +108,7 @@ public class MainActivity extends BaseActivity {
} }
private boolean isFirstRun() { private boolean isFirstRun() {
return SpUtils.getBoolean(Constants.FIRST_RUN_KEY, false); return SpUtils.getBoolean(SpUtils.KEY_FIRST_RUN, false);
} }
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!