Created
May 8, 2019 09:24
-
-
Save michaelbukachi/51bca37194ea8e69b349bb2aa357d0b6 to your computer and use it in GitHub Desktop.
Get realm instance
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
fun getRealm(context: Context): Realm { | |
try { | |
Realm.init(get()) | |
} catch (e: Exception) { | |
} | |
val config = RealmConfiguration.Builder() | |
.schemaVersion(1) | |
.migration(Migration()) | |
.build() | |
return Realm.getInstance(config) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment