Answer the question
In order to leave comments, you need to log in
Look please. What does this error mean?
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ru.startandroid.develop.retrofittest, PID: 21052
java.lang.NullPointerException: holder.itemView.titleTV must not be null
at ru.startandroid.develop.retrofittest.fragment.MyAdapter.onBindViewHolder (MyAdapter.kt:22)
at ru.startandroid.develop.retrofittest.fragment.MyAdapter.onBindViewHolder(MyAdapter.kt:12)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx. recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
Answer the question
In order to leave comments, you need to log in
This is the dereference of a null pointer. Obviously, you are using findViewById, which returns the "View!" platform type, and you yourself have to decide at this point whether it can be null or not. Obviously, you are looking for an IT view that is not in the layout.
At the junction of Java and Kotlin, there are such jokes, so you need to be careful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question