Call bundle.clear() before inserting CurLatLng

This commit is contained in:
misaochan 2018-04-18 19:45:44 +10:00
parent 93ec7bcb3e
commit b200a2935b

View file

@ -363,10 +363,12 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|| locationChangeType.equals(LocationServiceManager.LocationChangeType.PERMISSION_JUST_GRANTED)) { || locationChangeType.equals(LocationServiceManager.LocationChangeType.PERMISSION_JUST_GRANTED)) {
progressBar.setVisibility(View.VISIBLE); progressBar.setVisibility(View.VISIBLE);
//TODO: This hack inserts curLatLng before populatePlaces is called (see #1440). Ideally a proper fix should be found
Gson gson = new GsonBuilder() Gson gson = new GsonBuilder()
.registerTypeAdapter(Uri.class, new UriSerializer()) .registerTypeAdapter(Uri.class, new UriSerializer())
.create(); .create();
String gsonCurLatLng = gson.toJson(curLatLang); String gsonCurLatLng = gson.toJson(curLatLang);
bundle.clear();
bundle.putString("CurLatLng", gsonCurLatLng); bundle.putString("CurLatLng", gsonCurLatLng);
placesDisposable = Observable.fromCallable(() -> nearbyController placesDisposable = Observable.fromCallable(() -> nearbyController
@ -397,9 +399,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
if (placeList.size() == 0) { if (placeList.size() == 0) {
ViewUtil.showSnackbar(findViewById(R.id.container), R.string.no_nearby); ViewUtil.showSnackbar(findViewById(R.id.container), R.string.no_nearby);
} }
//TODO: This hack inserts curLatLng before populatePlaces is called (see #1440). Ideally a proper fix should be found
//bundle.clear();
bundle.putString("PlaceList", gsonPlaceList); bundle.putString("PlaceList", gsonPlaceList);
//bundle.putString("CurLatLng", gsonCurLatLng); //bundle.putString("CurLatLng", gsonCurLatLng);
bundle.putString("BoundaryCoord", gsonBoundaryCoordinates); bundle.putString("BoundaryCoord", gsonBoundaryCoordinates);