<https://developer.android.com/topic/libraries/vie...
# android
w
What is surprising here?
☝️ 1
p
Nullability annotations in kotlin code suprised me. And overrite annotations but no override keyword too 😛
And the missing type of the binding maybe too
i
No lateinit too
w
Oh, I focused on the binding being there 😄 Right, seems like a poor example there 😕
p
Why lateinit? @itnoles
i
Make sure binding get called and available by times I needed it
l
🤔 I belive there is a way to open up a issue against the android documentation. Perhaps somebody should re-write it with more idiomatic Kotlin code and submit an issue for them to fix it. As it is right now, new developers will learn bad practises by copying googles code.
p
At least it won't compile
🤣 2
@itnoles You don't need a lateinit there, that's why they introduced a backing property so you can acutally null it and remove the reference to the view tree
d
Thanks for mentioning this, by the way - best way to get visibility on issues is through the issue tracker https://source.android.com/setup/contribute/report-bugs#filing-a-bug
t
@itnoles
lateinit
here would defeat the purpose - you can’r set a lateinit property to null, so you wouldn’t be able to release the reference to the binder in
onDestroyView()
t
Great, exactly what I was after