Reputation: 626
I am using koin dependency injection. My Activity is in Java and Fragment is in Kotlin. The Viewmodel has constructor arguments.
Currently I am trying this in Activity
MyViewmodel viewmodel = get(MyViewmodel.class, null, () -> parametersOf(this));
And in Fragment
private val viewModel: MyViewmodel by sharedViewModel()
I am getting different instances. How to share a single instance here?
Upvotes: 1
Views: 1886