opt: independent runtime

This commit is contained in:
hyb1996
2017-12-08 22:45:31 +08:00
parent e8179cae94
commit b6f251da0b
30 changed files with 481 additions and 230 deletions

View File

@@ -0,0 +1,32 @@
package com.stardust.autojs;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
/**
* Created by Stardust on 2017/12/8.
*/
public class Pref {
private static Pref sInstance;
private SharedPreferences mSharedPreferences;
public Pref(Context context) {
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
}
public static void setInstance(Pref instance) {
if (sInstance != null)
throw new IllegalStateException();
sInstance = instance;
}
public static Pref getInstance() {
return sInstance;
}
}