Skip to content

Instantly share code, notes, and snippets.

@tunitowen
Created May 19, 2017 08:13
Show Gist options
  • Save tunitowen/9ff1d83bd0c00e8c808ce1952ef54f3b to your computer and use it in GitHub Desktop.
Save tunitowen/9ff1d83bd0c00e8c808ce1952ef54f3b to your computer and use it in GitHub Desktop.
Room-GettingStarted-AppSetup
class MyApp : Application() {
companion object {
var database: MyDatabase? = null
}
override fun onCreate() {
super.onCreate()
MyApp.database = Room.databaseBuilder(this, MyDatabase::class.java, "we-need-db").build()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment