public static synchronized void initialize(Application application) { if (sIsInitialized) { Log.v("ActiveAndroid already initialized."); return; } sContext = application; sModelInfo = new ModelInfo(application); sDatabaseHelper = new DatabaseHelper(sContext); sEntities = new HashSet<Model>(); sIsInitialized = true; openDatabase(); Log.v("ActiveAndroid initialized succesfully."); }
public static synchronized void dispose() { checkInitialization(); closeDatabase(); sEntities = null; sModelInfo = null; sDatabaseHelper = null; sIsInitialized = false; Log.v("ActiveAndroid disposed. Call initialize to use library."); }
public static synchronized void clear() { sEntities = new HashSet<Model>(); Log.v("Cache cleared."); }