java.lang.IndexOutOfBoundsException

Invalid index 20, size is 20

Samebug tips1

tip

Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range. Applications can subclass this class to indicate similar exceptions.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web4202

  • via GitHub by Rtsunoath
    ,
  • Stack trace

    • java.lang.IndexOutOfBoundsException: Invalid index 20, size is 20 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.sinaweibo.adapter.HomeAdapter.convert(HomeAdapter.java:39) at com.sinaweibo.adapter.HomeAdapter.convert(HomeAdapter.java:28) at com.chad.library.adapter.base.BaseQuickAdapter.onBindViewHolder(BaseQuickAdapter.java:538) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5768) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5801) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5037) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4913) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1414) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377) at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1193) at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1043) at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4357) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:549) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    winer222winer222
    3 times, last one,
    Indri YunitaIndri Yunita
    81 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    filpgamefilpgame
    4 times, last one,
    justCodeitjustCodeit
    1 times, last one,
    237 more bugmates