https://kotlinlang.org logo
#announcements
Title
# announcements
p

pawel.rybicki

09/03/2019, 3:55 PM
(once again sry for how this issue is presented)
s

streetsofboston

09/03/2019, 3:56 PM
Can you post a stack-trace…
1
p

pawel.rybicki

09/03/2019, 3:58 PM
Sure, I mean, the field was null so I got the crash, I have debugged it and found this specific issue, stack below :
IMG_20190903_175845.jpg
s

streetsofboston

09/03/2019, 4:00 PM
Yup, super-class constructor calling overridable method…. poor API design leading to hard-to-debug-issues… Glad you found it.
e

Eugen Martynov

09/03/2019, 4:00 PM
Exactly what was guessed!
put it into constant outside of the class
or in companion
s

streetsofboston

09/03/2019, 4:01 PM
Android’s
TextView
should not call overloadable methods in its constructor. Or
setText(....)
should be final….
e

Eugen Martynov

09/03/2019, 4:07 PM
Tell it to Android team 🙂
😁 1
p

pawel.rybicki

09/03/2019, 4:09 PM
Thanks guys I wasnt expecting such thing
2 Views