java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2

tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    quiz app sqlite

    Android Enthusiasts | 9 months ago | Nasim Ahmed
    java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
  2. 0

    Android SQLITE quiz app part 2

    Stack Overflow | 9 months ago | Nasim Ahmed
    java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
  3. 0
    samebug 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.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Simple Adapter, Invalid index when filtering

    Stack Overflow | 3 years ago | M0NKEYRASH
    java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IndexOutOfBoundsException

    Invalid index 2, size is 2

    at java.util.ArrayList.throwIndexOutOfBoundsException()
  2. Java RT
    ArrayList.get
    1. java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
    2. java.util.ArrayList.get(ArrayList.java:308)
    2 frames
  3. com.example.nasimahmed
    WorldHistory$1.onClick
    1. com.example.nasimahmed.quizgame.WorldHistory$1.onClick(WorldHistory.java:68)
    1 frame
  4. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:5198)
    2. android.view.View$PerformClick.run(View.java:21147)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:148)
    6. android.app.ActivityThread.main(ActivityThread.java:5417)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    2 frames