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

nerdstone

01/22/2019, 2:24 PM
This is the error
r

rkeazor

01/22/2019, 3:07 PM
it says you tried to access the property before initializing it
b

Brian

01/22/2019, 6:15 PM
is
displayUserDetails
getting called before
bindViews
?
n

nerdstone

01/22/2019, 10:53 PM
I call
displayUserDetails
in another fragment while bindviews is called on
oncreateview
of UserDetailsFragment
b

Brian

01/22/2019, 11:03 PM
if you put two breakpoints in the debugger, are you sure that
bindViews
is being called before
displayUserDetails
?
the error makes it seem like it’s not
or maybe there’s no TextView with the id
nameTextView
in the
user_details_fragment
?
n

nerdstone

01/23/2019, 12:40 AM
I actually figured it out. I was passing data to the "UserDetailsFragment" wrongly.
I have passed the data as bundle using the
arguments
property then reading them in the details fragment and it has worked.
👍 1