I am trying to pass the latitude and Longitude from the onLocationChanged in the MainActivity to another packagecom.route.provider
classDataPrivider
b
LatLng
cannot be passed like that (sadly).
EDIT: Daniel Nugent exposed and proved that indeed LatLng
IS Parcelable. Therefor, it's solution is better than mine I must admit And I just learn something too.
I would suggest to save lat/lng values separately:
intent.putExtra("latitude", latLng.latitude);
intent.putExtra("longitude", latLng.longitude);
Then retrieve them like so:
final double latitude = getIntent().getDoubleExtra("latitude");
final double longitude = getIntent().getDoubleExtra("longitude");
final LatLng = new LatLng(latitude, longitude);