Y
Y
Yuri Sika2020-10-07 19:06:06
Kotlin
Yuri Sika, 2020-10-07 19:06:06

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

1 answer(s)
D
Denis Zagaevsky, 2020-10-07
@YuraSika25

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 question

Ask a Question

731 491 924 answers to any question