Created
May 19, 2017 08:13
-
-
Save tunitowen/9ff1d83bd0c00e8c808ce1952ef54f3b to your computer and use it in GitHub Desktop.
Room-GettingStarted-AppSetup
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
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