i.e.: Activity have an TextView that must be updat...
# android
a
i.e.: Activity have an TextView that must be updated since Fragment but this TextView is a lateinit var that might not have been initialized when thisFragment updates its value. I am trying to check if it's null with ? operator but this always give me that variable cannot be null.
g
If you need to check lateinit property, usually it sign that you just need nullable property instead
👍 1
✔️ 1
a
Okey I am going to update that textview to nullable property
g
There is special
::property.isInitialized
intrinsic, but I wouldn’t recommend to use it, just make property nullable
a
Yup I know about that but it's only working in the class that contains the lateinit property if I call that outside the Activity class that contains the property it does not work
😞
Nullable property lets go -!!
Thanks!
g
Again, if you have case when property have to be checked just use nullable, this is exactly why nullable exist
a
Okey @gildor thank you dude!
👍 1