New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double notifyDataSetChanged may cause crash #17
Comments
Maybe an |
Would you be able to create a sample project that demonstrates the crash? |
Sure, here it is |
Great, thanks for this! It seems like the fix will be quite simple although it will require a bit of testing. |
Fixes a crash caused by pending updates attempting to operate on a annotation list that is no longer there. Fixes TradeMe#17
I don't know if it's a bad use of the library or not, but when performing the following sequence of actions, bad things can occur.
notifyDataSetChanged()
. After that,getItemCount()
gets called, returning 1 as result.notifyDataSetChanged()
. After that,getItemCount()
gets called, returning 0 as result.onCreateAnnotation(...)
with position=0, leading to a crash since there are no items in the list.Apparently, the adapter remembers the first amount of annotations to be added to the map, but the second call to
notifyDataSetChanged()
does not get taken into account.The text was updated successfully, but these errors were encountered: