init
Sets a reference to the application's Dagger graph, so that it can be accessed by TangleViewModelFactory.
This should be initialized as soon as possible after initializing the AppComponent.
Since
0.10.0
Samples
import android.app.Application
import tangle.viewmodel.TangleGraph
fun main() {
//sampleStart
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
val appComponent = DaggerMyAppComponent.factory()
.create(this)
TangleGraph.init(appComponent)
}
}
//sampleEnd
}
Parameters
component
the application-scoped Dagger component
Sources
androidJvm source
Link copied to clipboard