I’m on the way of developing application using Google Map API,
I draw the path of two points (GeoPoint) successful.
And when changing from portrait to landscape,
The map will invalidate (because of activity life-cycle), you know?
So, I lost two that points.
I know we must save two that points in method onSavedInstanceState(Bundle outState).
Therefore, I want to save two that point (GeoPoint) for draw again when changing from portrait to landscape.
I don’t know how to put GeoPoint into that Bundle in that method.
Please tell me?
Regards!
the API docs tells me
Geopointhas a constuctor with two params: latitude, longitude. Both attributes have getters. So either you obtain those and put them in theBundle, or you extend the class and make it parcellable, or make a wrapper class. Either solution will work just fine.Try this, I suspect it’ll work just fine.
Then, put it in your
Bundlewithbundle.putParcelable("MYPOINT", geopointParcelable)