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

yousuf.haque

05/19/2017, 3:55 PM
i have a fragment, and a mapView, and in my fragment’s onstart, I’m trying to call mapView.onstart
m

myanmarking

05/19/2017, 3:58 PM
yousuf.haque: can you even reference a view before onCreateView?
hm, ya onStart is after
y

yousuf.haque

05/19/2017, 3:58 PM
no, but onCreateView is called before fragment’s onStart
m

myanmarking

05/19/2017, 3:59 PM
do the following
do you know the shortcut to ‘show kotlin bytecode’
sometimes that help
find the shortcut: ‘show kotlin bytecode’. and then go to the class and use decompile
it’s easier to debug that way where you can see the extension plugin code
y

yousuf.haque

05/19/2017, 4:01 PM
mm alright, ill check that out, thanks
m

myanmarking

05/19/2017, 4:02 PM
i just checked. it should be the same. android extensions use ´findViewById´and puts it into a map. so if there is a valid context where you calling it, it shouldnt get u a NPE
are you, by any chance, accessing that view inside a run block in the mapview?