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

前端 未结 2 1202
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-19 19:28

Im getting some weird error which crashing my android app. Its a quiz app. So when user answer 2/3 question correctly then click the next button this it crash. and show inde

2条回答
  •  滥情空心
    2021-01-19 19:40

    This typically happens when you remove something from the screen and don't do it on the updateThread. Make sure that any place you are removing items that you call it like this

    runOnUpdateThread(new Runnable() {
    @Override
    public void run() {
    // TODO Auto-generated method stub
       //remove/detach your stuff in here
    }
    });
    

    See this similar question - How can repair this error? "java.lang.IndexOutOfBoundsException"

提交回复
热议问题