Save Graphics on Map Rotation

3459
2
03-19-2012 06:26 AM
BrianGustafson
New Contributor III
Is there away to save the graphics in the graphics layer on map rotation?  Do I need to store something in a SQLite database?
0 Kudos
2 Replies
PatrickBarnhart
New Contributor
Try adding this to the map activity in your manifest xml and see if it does what you need - it doesn't save them anywhere but it does keep your graphic layers from being wiped when the device orientation changes, if that's what you're after.

        <activity android:label="@string/app_name" android:name="your.package.activity" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

with this I didn't have to use onRetainNonConfigurationInstance()/getLastNonConfigurationInstance() to rebuild the map, onCreate gets called once, etc.  Found it in the HelloWorld example after doing some digging.
0 Kudos
DineshMathur
New Contributor II
ESRI is about to release next version of the API in this week. This version is expected to be having a sample for workaround for offline editing.
This sample should give you information about how to save features/graphics into a file.

Hope this will be able to solve your problem.

Good Luck

Dinesh Mathur
0 Kudos