Support Topics Documentation Slack YouTube Blog

GeoPoint in Android bundle not serialized properly

Hi, So I have a main Activity and a detail Activity. in the Main activity an Object with one GeoPoint object inside. I’ve logged the GeoPoint to make sure all the data is there in the Main Activity. I try to pass the bundle to the detail Activity in the bundle and retrieve it using getSerializable. I log that Object in the detail activity. I verify that I am sending the Geopoint object but all the fields are null in the detail activity.
This is what I see in the Main logs:
GeoPoint: GeoPoint{objectId=‘0C91C3FA-22C9-2A59-FF92-F29DDF0A6A00’, latitude=37.8092687, longitude=-122.2683876, categories=[Default], metadata={name=Tierra Mia Coffee…
This is what I see in the logs on the detail Activity:
GeoPoint: GeoPoint{objectId=‘null’, latitude=null, longitude=null, categories=[], metadata={}, distance=null}
Is it just not possible to send the GeoPoint in a bundle?..I’m trying to limit the number of API calls I have. Each main object only contains a single Geopoint.

*I can send BackendlessUser to different activities without any issues.

Hi, i can see why it is not working The GeoPoint class inherits from BaseGeoPoint, which does not implement Serializable. All the properties of GeoPoint come from BaseGeoPoint and, as a result, they are all null after deserialization.

Your best option right now is to create your own serializable class which has the same properties as in GeoPoint. When you need to pass GeoPoint between activities, create a replica of GeoPoint using your class and then after deserialization, recreate GeoPoint.