https://kotlinlang.org logo
#android
Title
# android
w

wasyl

01/13/2020, 10:41 PM
What is surprising here?
☝️ 1
p

Paul Woitaschek

01/13/2020, 11:19 PM
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

itnoles

01/13/2020, 11:29 PM
No lateinit too
w

wasyl

01/13/2020, 11:30 PM
Oh, I focused on the binding being there 😄 Right, seems like a poor example there 😕
p

Paul Woitaschek

01/13/2020, 11:31 PM
Why lateinit? @itnoles
i

itnoles

01/13/2020, 11:36 PM
Make sure binding get called and available by times I needed it
l

Luke Sleeman

01/14/2020, 6:04 AM
🤔 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

Paul Woitaschek

01/14/2020, 6:37 AM
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

Dustin Lam

01/14/2020, 5:15 PM
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

Tim Malseed

01/14/2020, 10:07 PM
@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

Tim Malseed

01/15/2020, 4:30 AM
Great, exactly what I was after
2 Views