java.lang.IndexOutOfBoundsException

Invalid index 2, size is 2

Samebug tips1

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.

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

Solutions on the web7190

  • via GitHub by kxs109
    , 8 months ago
    Invalid index 2, size is 2
  • Invalid index 2, size is 2
  • via Google Groups by Dante vd merwe, 1 week ago
    Invalid index 2, size is 2
  • Stack trace

    • java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.roam1.roam1_selfcare.InstructionAdapter.getItemViewType(InstructionAdapter.java:117) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4960) 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.scrollByInternal(RecyclerView.java:1552) at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2649) at android.view.View.dispatchTouchEvent(View.java:9297) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2549) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254) at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737) at android.app.Activity.dispatchTouchEvent(Activity.java:2769) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:63) at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364) at android.view.View.dispatchPointerEvent(View.java:9517) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4108) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3654) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3707) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3673) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3799) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3681) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3856) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3654) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3707) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3673)

    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

    Once, 7 months ago
    586 times, 9 months ago
    Once, 11 months ago
    3 times, 11 months ago
    Once, 1 year ago
    241 more bugmates