(room) add room gradle file
This commit is contained in:
parent
6ce3b98615
commit
451229779f
2 changed files with 8 additions and 5 deletions
|
@ -28,6 +28,10 @@ public class TuskyApplication extends Application {
|
|||
|
||||
private static AppDatabase db;
|
||||
|
||||
public static AppDatabase getDB() {
|
||||
return db;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
@ -54,10 +58,6 @@ public class TuskyApplication extends Application {
|
|||
}
|
||||
|
||||
db = Room.databaseBuilder(getApplicationContext(),
|
||||
AppDatabase.class, "tuskyDB").build();
|
||||
}
|
||||
|
||||
public static AppDatabase getDB() {
|
||||
return db;
|
||||
AppDatabase.class, "tuskyDB").allowMainThreadQueries().build();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue