When I rotate my device, Google Maps v2 refreshes. How do I prevent this refresh from occurring? I'm adding the map dynamically in a tab of a SherlockFragment.
I fixed the problem by adding to the Activity in AndroidManifest.xml:
android:configChanges="orientation|screenSize"
Edit (04/28/2017) :
From the Android Documentation:
Note: Using this attribute should be avoided and used only as a last resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.
Maybe you could look at this answer, which properly saves the SupportMapFragment using the Bundle available in the onCreate method of FragmentActivity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With