Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Component used: androidx.recyclerview:recyclerview-selection Version used: 1.1.0 Devices/Android versions reproduced on: Android 10
Stack trace: See motionInputCrash.txt attachment.
In the application I've been working on over the last year I've received various reports about the app crashing intermittently. These crashes all share the same stack trace shown in the attachment. My own investigation into this crash has lead to the following info about the crash that is being reported. It is occurring because the ItemDetailsLookup.ItemDetails implementation used by the view holder for my recycler adapter is returning RecyclerView.NO_POSITION on the call to getPosition of the item details implementation.
My understanding of the API RecyclerView.ViewHolder.getAdapterPosition is that it will return RecyclerView.NO_POSITION when the call is made while the RecyclerView is the middle of a layout pass. So is it a bug with the selection library that the MotionInputHandler.selectItem can be executed while the RecyclerView is in the middle of a layout pass? Or is it a bug with my application's ItemDetailsLookup.ItemDetails implementation not correctly handling the scenario for when it could be called while the RecyclerView is performing a layout pass?