andrewb

Screen Rotation issues when targeting Android API levels greater than 13

Discussion created by andrewb on Apr 4, 2013
Latest reply on Aug 22, 2013 by doneill-esristaff
I recently set my app to target Android API level 14(ICS).  Now when I rotate the map I lose any graphics on a graphics layer and I lose my callout if visible.   I've narrowed down the problem to the onRetainNonConfigurationInstance() method.  I checked the Android API documentation and It has been depreciated at level 13 in favor of using Fragment.setRetainInstance(true);.  Well, I'm not using Fragments.

/** Called by the system, as part of destroying an activity due to a configuration change. */
    @Override
    public Object onRetainNonConfigurationInstance() {
        return mMapView.retainState();
    }


Android API Documentation:  http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance()


H
ow can I target API level 14 and retain my map state without using Fragments?

Outcomes