Small fix for google places.
parent
a97ea439f6
commit
00e5e7dfdf
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue