D
D
Daniel2018-06-22 21:53:39
Java
Daniel, 2018-06-22 21:53:39

Problem in RecycleView?

Please help fix the error.
below log

spoiler

06-22 21:52:03.485 11043-11043/ru.stalkerweb.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: ru.stalkerweb.app, PID: 11043
java.lang.StringIndexOutOfBoundsException: length=82; index=120
at java.lang.String.substring(String.java:1971)
at ru.stalkerweb.app.RecyclerAdapter.onBindViewHolder(RecyclerAdapter.java:75)
at ru.stalkerweb.app.RecyclerAdapter.onBindViewHolder(RecyclerAdapter.java:14)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6310)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6343)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5289)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5552)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5394)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5390)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2149)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1533)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1496)
at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1313)
at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1058)
at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4680)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
at android.view.Choreographer.doCallbacks(Choreographer.java:790)
at android.view.Choreographer.doFrame(Choreographer.java:718)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7425)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
06-22 21:52:03.505 11043-11043/ru.stalkerweb.app I/Process: Sending signal. PID: 11043 SIG: 9

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-06-22
@shevyrinn

When you called the String.substring() method, you passed in one of its arguments a position in the string equal to 120, when the actual length of the string is only 82 characters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question