public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mMapView = (MapView) findViewById(R.id.map); mMapView.addLayer(new ArcGISDynamicMapServiceLayer("" +"http://myserver/ArcGIS/rest/services/OK_GDKarta/MapServer")); mMapView.addLayer(new ArcGISDynamicMapServiceLayer("" +"http://myserver/ArcGIS/rest/services/GDDynamic_EDIT/MapServer")); graphicsLayer = new GraphicsLayer(); mMapView.addLayer(graphicsLayer); Object init = getLastNonConfigurationInstance(); if (init != null) { mMapView.restoreState((String) init); } }
//Retrieve the non-configuration instance data that was previously returned. Object init = getLastNonConfigurationInstance(); if (init != null) { map.restoreState((String) init); }
<activity android:name="YourMapActivity" android:configChanges="keyboardHidden|orientation">
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.