Closed dellisd closed 6 years ago
Thanks for the report!
Is this happening after calling notifyDatasetChanged on an empty list? Or simply after attaching the adapter?
I've tried to replicate this in the sample app with an empty list, but no luck. Can you confirm that the getItemCount method of the adapter is returning 0 when this happens?
Maybe I'm going crazy, but I don't seem to be able to reproduce it now (I worked around it). If I come across it again I'll post more info.
Ok great, I'll close the issue for now.
I think I have found the actual cause of the issue. The crash seems to occur when DiffUtil
is used on an adapter with an empty list of data.
In the current set up I have, the MapAdapter
is initialized in onCreate
, attach()
and notifyDataSetChanged()
are called in getMapAsync
. I then obtain data from a local database and then run a DiffUtil
on it and dispatch it to the adapter. (Debugging confirmed that it reached the dispatching step).
Once the DiffUtil
result was dispatched to the adapter, the app crashes with the same stack trace provided as above.
I think I forgot how to use DiffUtil... my bad.
When a MapAdapter is initialized with an empty list of items, it crashes.