Join Slack
How do I create a `ViewModel` class with a constructor that takes parameters? I found this advice, b...
# android
e
Ellen Spertus
04/03/2020, 10:39 PM
How do I create a
ViewModel
class with a constructor that takes parameters? I found this advice, but there’s a comment saying it’s deprecated.
https://www.albertgao.xyz/2018/04/13/how-to-add-additional-parameters-to-viewmodel-via-kotlin/
stackoverflow
1
m
Michael Bernier
04/03/2020, 10:43 PM
https://developer.android.com/reference/androidx/lifecycle/ViewModelProvider.Factory
🥇 2
22
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by