IndexOutOfBoundsException - RecycleView
Hi, I'm getting this exception when i scroll fast on a recycleview. do you have ani idea what am I doing wrong?
java.lang.IndexOutOfBoundsException: Invalid index 1, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.facebook.drawee.controller.ForwardingControllerListener.onFailure(ForwardingControllerListener.java:133) at com.facebook.drawee.controller.AbstractDraweeController.onFailureInternal(AbstractDraweeController.java:520) at com.facebook.drawee.controller.AbstractDraweeController.access$100(AbstractDraweeController.java:47) at com.facebook.drawee.controller.AbstractDraweeController$1.onFailureImpl(AbstractDraweeController.java:427) at com.facebook.datasource.BaseDataSubscriber.onFailure(BaseDataSubscriber.java:59) at com.facebook.datasource.AbstractDataSource$1.run(AbstractDataSource.java:177) 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:5221) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Are you using ControllerListeners? If so, can you provide your code?
From the stack trace it seems that ForwardingControllerListener.onFailure gets cleared while being iterated over. This method is synchronized meaning that this can only happen if one of the child controller listeners causes the issue. This may happen if for example you have a controller listener that onFailure attempts to set a new Uri to the DraweeView.