Created
February 14, 2018 05:51
-
-
Save Sinarahimi/c4d020800b4218e4bb448e3dd13baff7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Database(entities = Movie.class, version = 1, exportSchema = false) | |
public abstract class AppDatabase extends RoomDatabase { | |
public static final String DATABASE_DB = "database.db"; | |
private static AppDatabase appDatabase; | |
public static AppDatabase getInstance(Context context) { | |
if (appDatabase == null) { | |
appDatabase = Room.databaseBuilder(context, AppDatabase.class, DATABASE_DB).allowMainThreadQueries().build(); | |
} | |
return appDatabase; | |
} | |
public abstract MovieDao getMovieDao(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment