How can I run the println function in init and sti...
# android
b
How can I run the println function in init and still use the delegate in the fragment?
🧵 1
s
by viewModels() is lazy, has your view model been initialized?
a
init
should be without parentheses
âž• 1
and
viewModel
should be
val
, not
var
âž• 1
b
You can inject directly with dagger
It's very simple way
i
or with koin - it’s even simpler