How i can send constructor variables while using `...
# android
k
How i can send constructor variables while using
viewModels
ktx extension function ?
h
by viewModels
is an extensions provided by koin?
b
You have to use a factory to inject
h
@Kulwinder Singh I’m using
<https://github.com/InsertKoinIO/koin>
Untitled.kt
h
Maybe you can create a separate class to hold the user instances and share this UserHolder by koin to access the actual data. You can try with this strategy but I don’t know if those can fit your needs.
k
@HarryPulvirenti @Heitor Ribeiro no i'm not using
koin
,
by viewModel
is from
fragment-ktx
https://developer.android.com/kotlin/ktx#fragment
@Blundell any example/sample ? i remember i have done similar in past, but that was without
by viewModel
also i forgot how it was in past
or use #koin 🙂
👎 1
🤩 1
👍 3
p
search cdelab kotlin fundamentals android. use viewmodelfactory
👍 1
k
@pitpit thanks, i found it inside codelab