Small fix for google places.

master
Tomasz Półgrabia 2016-10-09 14:51:07 +02:00
parent a97ea439f6
commit 00e5e7dfdf
1 changed files with 6 additions and 6 deletions

View File

@ -274,13 +274,13 @@ public class PlacesFragment extends Fragment {
response.getNextPageToken()); response.getNextPageToken());
ListView placesWidget = (ListView) getView().findViewById(R.id.google_places); ListView placesWidget = (ListView) getView().findViewById(R.id.google_places);
if (nextPageToken == null) { PlacesAdapter adapter = (PlacesAdapter)placesWidget.getAdapter();
places = response.getPlaces(); if (adapter == null) {
PlacesAdapter adapter = new PlacesAdapter(getActivity(), places); adapter = new PlacesAdapter(getActivity(), new ArrayList<GooglePlaceResult>());
placesWidget.setAdapter(adapter); placesWidget.setAdapter(adapter);
} else { }
places.addAll(response.getPlaces());
PlacesAdapter adapter = (PlacesAdapter)placesWidget.getAdapter(); if (response.getPlaces() != null) {
adapter.addAll(response.getPlaces()); adapter.addAll(response.getPlaces());
} }