Closed vincent-paing closed 4 years ago
This looks like a race condition that can be fixed by ensuring operations are done sequentially (coroutines can help here).
I prefer to not add that extension to Splitties, mainly because it's more a band-aid solution that doesn't solve the root problem.
I just found out about this library and wanted to contribute with an extension function I've been using for Spinners.
Problem : Spinners has
setSelection
function that can throwIndexOutOfBounds
when you select an item that doesn't exist in that index. Sometimes, an edge case could happen when you just invalidate the data in adapter at the same time, your spinnersetSelection
has been invoked, which cause the app to crash.So, I come up with this function
If this can be added, I'm more than happy to submit a PR