Join Slack
Powered by
how can I pass a property to a companion object?
# getting-started
d
Daniele B
05/12/2021, 12:37 PM
how can I pass a property to a companion object?
m
Michael Böiers
05/12/2021, 1:04 PM
Doesn’t make sense. The companion object is static, so there isn’t any instance of Navigation to access for the stateManager object.
☝️ 3
d
Daniele B
05/12/2021, 1:07 PM
yes, you are right, thanks
m
Michael Böiers
05/12/2021, 1:10 PM
Interestingly, the reverse is possible even like this 🙂
👍 2
a
Amit Krishna A
05/13/2021, 8:15 AM
I think you could change it to a lateinit var and initialize it in the init block of Navigation class.
5
Views
Open in Slack
Previous
Next