我正常加载回收站,数据显示正确。但我需要在特定条件下重新创建我的活动。当我重新创建我的活动时,Recycler 视图会再次初始化并加载新的数据集。但这一次我遇到了崩溃。以下是日志。任何帮助将非常感激.. !!!
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: start < 0 || end > len. start=-1, end=11, len=11
at java.util.Arrays.checkStartAndEnd(Arrays.java:1732)
at java.util.Arrays.fill(Arrays.java:803)
at android.support.v7.widget.StaggeredGridLayoutManager$LazySpanLookup.invalidateAfter(StaggeredGridLayoutManager.java:2652)
at android.support.v7.widget.StaggeredGridLayoutManager.handleUpdate(StaggeredGridLayoutManager.java:1496)
at android.support.v7.widget.StaggeredGridLayoutManager.onItemsUpdated(StaggeredGridLayoutManager.java:1472)
at android.support.v7.widget.RecyclerView$6.dispatchUpdate(RecyclerView.java:781)
at android.support.v7.widget.RecyclerView$6.onDispatchFirstPass(RecyclerView.java:769)
at android.support.v7.widget.AdapterHelper.dispatchFirstPassAndUpdateViewHolders(AdapterHelper.java:316)
at android.support.v7.widget.AdapterHelper.dispatchAndUpdateViewHolders(AdapterHelper.java:302)
at android.support.v7.widget.AdapterHelper.applyUpdate(AdapterHelper.java:222)
at android.support.v7.widget.AdapterHelper.preProcess(AdapterHelper.java:106)
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1492)
at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:151)
at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:305)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)