Last active
July 27, 2019 10:05
-
-
Save Audhil/e79e5385d2ccf215ed1f7cbd359c1e76 to your computer and use it in GitHub Desktop.
Application class - https://android.jlelse.eu/instrumentation-testing-with-dagger2-retrofit2-mockwebserver-android-4cca7cb7373c
This file contains hidden or 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
open class GitHubDelegate : Application() { | |
open lateinit var appDaggerComponent: GitHubAppComponent | |
override fun onCreate() { | |
super.onCreate() | |
appDaggerComponent = getAppComponent() | |
appDaggerComponent.inject(this) | |
} | |
// returns app component | |
open fun getAppComponent(): GitHubAppComponent = | |
DaggerGitHubAppComponent | |
.builder() | |
.applicationModule(ApplicationModule(this)) | |
.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment