googlearchive / android-play-places

Deprecated:
https://github.com/googlemaps/android-places-demos
Apache License 2.0
477 stars 580 forks source link

Fix PlaceAutocompleteAdapter data modification from background thread #38

Closed nikson closed 8 years ago

nikson commented 8 years ago

Filter (protected FilterResults performFiltering()) is modifying the data in background, it crashed when getItem() is accessed from UI-thread. Following error also generate when publishResults invoked.

Fatal Exception: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(-1, class android.widget.ListPopupWindow$DropDownListView) with Adapter

The sample code is not correct and it rise these (#23, #27) expected issues when integrate in application.

Fix #27, #23

googlebot commented 8 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


googlebot commented 8 years ago

CLAs look good, thanks!

nikson commented 8 years ago

Hi @jfschmakeit, can you please have a look at this issue?

edumucelli commented 8 years ago

Wow, this fix a nasty bug I had when using this PlaceAutoCompleteAdapter! Thanks @nikson

kanetik commented 8 years ago

Is anyone maintaining this repo? There's 4 open PRs here, this one being a HUGE fix that absolutely needs to be merged in.

stephenmcd commented 8 years ago

Thanks @nikson