LolApplication.java :  » UnTagged » lolreference-android » com » idunnolol » reference » app » Android Open Source

Android Open Source » UnTagged » lolreference android 
lolreference android » com » idunnolol » reference » app » LolApplication.java
package com.idunnolol.reference.app;

import android.app.Application;

import com.idunnolol.reference.data.ItemDatabase;
import com.idunnolol.reference.data.MasteryDatabase;
import com.idunnolol.reference.data.RuneDatabase;

public class LolApplication extends Application {

  private ItemDatabase mItemDatabase = null;

  private MasteryDatabase mMasteryDatabase = null;

  private RuneDatabase mRuneDatabase = null;

  public ItemDatabase getItemDatabase() {
    if (mItemDatabase == null) {
      mItemDatabase = new ItemDatabase(this);
    }

    return mItemDatabase;
  }

  public MasteryDatabase getMasteryDatabase() {
    if (mMasteryDatabase == null) {
      mMasteryDatabase = new MasteryDatabase(this);
    }

    return mMasteryDatabase;
  }

  public RuneDatabase getRuneDatabase() {
    if (mRuneDatabase == null) {
      mRuneDatabase = new RuneDatabase(this);
    }

    return mRuneDatabase;
  }

  @Override
  public void onLowMemory() {
    super.onLowMemory();

    // Free up some memory for those who might want it
    mItemDatabase = null;
    mMasteryDatabase = null;
    mRuneDatabase = null;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.