RecyclerViewEnhanced icon indicating copy to clipboard operation
RecyclerViewEnhanced copied to clipboard

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

Open ugurcany opened this issue 7 years ago • 0 comments

When the RecyclerView is empty and I click somewhere on empty screen, I'm getting the following exception inside onRowClicked(int position) since callback calls this method although it should not:

09-27 15:16:37.669 24445-24445/cc.chatstop.android E/InputEventReceiver: Exception dispatching input event.
09-27 15:16:37.669 24445-24445/cc.chatstop.android E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
09-27 15:16:37.673 24445-24445/cc.chatstop.android E/MessageQueue-JNI: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
                                                                           at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
                                                                           at java.util.ArrayList.get(ArrayList.java:308)

BTW, I'm using setStackFromEnd(true) for my RecyclerView. Probably, that causes a mistaken callback for an empty list. Please check it.

ugurcany avatar Sep 27 '16 12:09 ugurcany