Created
October 10, 2020 16:34
-
-
Save ramonrabello/1daab059acfdab036f3821ad795089e0 to your computer and use it in GitHub Desktop.
1. MyApplication - Hilt Series: Migrando do Dagger para Hilt
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 MyApplication : Application() { | |
lateinit var appComponent: ApplicationComponent | |
@Inject | |
lateinit var logger: Logger | |
override fun onCreate() { | |
super.onCreate() | |
appComponent = DaggerApplicationComponent.factory().create(this) | |
appComponent.loggingComponent().create().apply { | |
logger().log("Initializing application") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment