Esempio n. 1
0
  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.");
  }
Esempio n. 2
0
  public static synchronized void dispose() {
    checkInitialization();
    closeDatabase();

    sEntities = null;
    sModelInfo = null;
    sDatabaseHelper = null;

    sIsInitialized = false;

    Log.v("ActiveAndroid disposed. Call initialize to use library.");
  }
Esempio n. 3
0
 public static synchronized void clear() {
   sEntities = new HashSet<Model>();
   Log.v("Cache cleared.");
 }