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

funrep

06/04/2017, 7:51 PM
m

menegatti

06/04/2017, 7:52 PM
funrep: just starting a thread
do you mind if I give some feedback?
f

funrep

06/04/2017, 7:52 PM
sure!
m

menegatti

06/04/2017, 7:53 PM
1st of all
onCreateView()
the
onCreateView
there doesn't have a
?
which is exactly what's causing your issue it seems
f

funrep

06/04/2017, 7:54 PM
you mean the return type of it or the call to super.onCreateView?
m

menegatti

06/04/2017, 7:54 PM
the call
on line 48
oh no... that's not right
f

funrep

06/04/2017, 7:55 PM
oh yeah, I forgot to annotate that bundle!
m

menegatti

06/04/2017, 7:55 PM
cool
try that
f

funrep

06/04/2017, 7:55 PM
Didn’t even realize it said onCreate*View*, thanks a lot it works now!
m

menegatti

06/04/2017, 7:55 PM
if it works then I can give some tips
cool
so, just some ideas
2nd, why not initialize
deliveries
with an empty list from the start so you don't need to declare nullable?
3rd, you can reduce line 36 to
super.onCreate(savedInstanceState ?: Bundle())
if the first parameter is null, the elvis operator
?:
defaults to the second, does that make sense?
f

funrep

06/04/2017, 7:57 PM
ah, great!
m

menegatti

06/04/2017, 7:58 PM
and 4th, I recommend that you read about
lateinit
, but you can use in your
listView
, then you don't need to set it as nullable
but overall, pretty good 😄
f

funrep

06/04/2017, 8:01 PM
awesome feedback, thanks a lot!
16 Views