gabrielemariotti/cardslib — pull request #304 by mattgmg1990 (2014-09-22 19:08:27+00:00)
Title: Track updates to underlying list in mInternalObjects on notifyDataSetChanged().

When working on my project, I realized that this important piece was missing to my previous pull request. If the list that the CardArrayAdapter is referencing is modified outside of the adapter and notifyDataSetChanged() is called, mInternalObjects will be in an incorrect state. This can completely break the undo functionality.

The solution is to totally regenerate mInternalObjects when notifyDataSetChanged is called, since we have no guarantee what state the ArrayList is in anymore. Using notifyDataSetChanged is a relatively common workflow, so this should be patched.