Search code examples
androidskmaps

Map becomes black for half second when screen orientation changed


I have an Android app that uses SKMaps version 3.0.2. If I run it on a Samsung s6, when I change the screen orientation the map is destroyed and recreated (the map becomes black for about half second). If I run it on a Nexus 6, when I change the screen orientation the map is not destroyed.

This is before rotation:

before rotation

This is shortly after rotation:

enter image description here

Does somebody know how to make the app not to be destroyed on the Samsung s6?


Solution

  • I have tested this matter on the Skobbler demo application on Samsung Galaxy S6 and Samsung Galaxy A7 and the behavior is the same.

    If android:configChanges="orientation|screenSize" statement is used in the AndroidManifest.xml for the activity that contains the map then the activity that contains the map is NOT destroyed, neither the map.

    If this statement is not used then the activity and the map are destroyed and then recreated immediately but no black screen appears.

    Make sure you use android:configChanges="orientation|screenSize" in your manifest file for the activity that contains the map.