SHARE
TWEET

Untitled

a guest Oct 12th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Database(entities = {AwardEntity.class, ProfileEntity.class}, version = 1)
  2. public abstract class FifaDatabase extends RoomDatabase {
  3.  
  4.     private static FifaDatabase INSTANCE;
  5.     static String TAG = "FifaDatabase";
  6.  
  7.     public abstract FifaDao fifaDao();
  8.  
  9.     public static FifaDatabase getAppDatabase(Context context) {
  10.         String DATABASE_NAME = "db-fifa";
  11.         if (INSTANCE == null) {
  12.             INSTANCE =
  13.                     Room.databaseBuilder(context
  14.                             , FifaDatabase.class
  15.                             , DATABASE_NAME)
  16.                             .build();
  17.         }
  18.         return INSTANCE;
  19.     }
  20.  
  21.     public static void destroyInstance() {
  22.         INSTANCE = null;
  23.     }
  24. }
RAW Paste Data
Top