daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest May 25th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package se.miun.krry1601.bathingsites;
  2.  
  3. import android.arch.persistence.room.Database;
  4. import android.arch.persistence.room.Room;
  5. import android.arch.persistence.room.RoomDatabase;
  6. import android.content.Context;
  7.  
  8. @Database(entities = {BathingSite.class}, version = 1)
  9. public abstract class AppDatabase extends RoomDatabase {
  10.  
  11.     private static AppDatabase INSTANCE;
  12.  
  13.     public abstract BathingSitesDatabase bathingSitesDatabase();
  14.  
  15.     public static AppDatabase getAppDatabase(Context context) {
  16.         if (INSTANCE == null) {
  17.             INSTANCE =
  18.                     Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "BathingSite")
  19.                             .allowMainThreadQueries()
  20.                             .build();
  21.         }
  22.         return INSTANCE;
  23.     }
  24.  
  25.     public static void destroyInstance() {
  26.         INSTANCE = null;
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top