How to hold the reference of the binding object in...
# android-architecture
t
How to hold the reference of the binding object in an activity? This is how we are handling
Copy code
private lateinit var binding: FragmentGardenBinding
Sometimes when activity is resumed, I'm getting the following crash and it's unable to reproduce
Copy code
lateinit property binding has not been initialized
f
When do you assign the binding to this attribute? After inflate on
onCreateView
?
Also, have you tried enable the “don’t keep activities” to test?
t
Yes that has been created on
onCreateView
And Don't keep activities is not enabled either