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

leodeleon

06/17/2017, 12:01 PM
Copy code
FATAL EXCEPTION: main
Process: com.leodeleon.popmovies, PID: 6911
java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$LayoutManager android.support.v7.widget.RecyclerView.getLayoutManager()' on a null object reference
at com.leodeleon.popmovies.feature.view.MoviesFragment.onCreateView(MoviesFragment.kt:65)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192)
r

radityagumay

06/17/2017, 12:11 PM
leodeleon: are you using anko? Is view not nu?
l

leodeleon

06/17/2017, 12:11 PM
not using anko
I moved the code to another method
OnViewCreated
now it’s working
r

radityagumay

06/17/2017, 12:43 PM
leodeleon: as I thought. You inflate the view which not current created