Skip to content

Instantly share code, notes, and snippets.

@AlirezaNezami96
Last active September 29, 2021 08:37
Show Gist options
  • Save AlirezaNezami96/44f5a3b2e36947254ed8c510e553bfdc to your computer and use it in GitHub Desktop.
Save AlirezaNezami96/44f5a3b2e36947254ed8c510e553bfdc to your computer and use it in GitHub Desktop.
create DatabaseService and NetworkService when onCreate method called
class MyApplication : Application() {
var networkService: NetworkService? = null
var databaseService: DatabaseService? = null
override fun onCreate() {
super.onCreate()
networkService = NetworkService(this, "SOME_API_KEY")
databaseService = DatabaseService(this, "dummy_db", 1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment