<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Map went blank after rotation in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725371#M5069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having this same issue. I have the "onPause" and "onResume" methods but my map is still being cleared after rotating the device. This is not good since doing so calls onCreate once again and my map loading process is a little too expensive to be repeating.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HELP!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 07:11:19 GMT</pubDate>
    <dc:creator>EDWINSANCHEZ</dc:creator>
    <dc:date>2012-03-16T07:11:19Z</dc:date>
    <item>
      <title>Map went blank after rotation</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725369#M5067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I developed my first app with the Android API. Everything seems working as expected, except that the map goes blank after the device rotates. The error thrown in Eclipse is as follow: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;03-09 15:52:46.363: E/libEGL(8091): call to OpenGL ES API with no current context (logged once per thread)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't do anything special for handling the rotation. All map initialization is in OnCreate. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea about how to fix the error or handle the rotation? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 18:59:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725369#M5067</guid>
      <dc:creator>TigerLeung</dc:creator>
      <dc:date>2012-03-09T18:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Map went blank after rotation</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725370#M5068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you remember to implement onPause() and onResume() as per the HelloWorldMap sample?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neglecting to do so can cause the map control not play nice with the Android application life cycle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 protected void onPause() {
&amp;nbsp; super.onPause();
&amp;nbsp; map.pause();
 }

 protected void onResume() {
&amp;nbsp; super.onResume();
&amp;nbsp; map.unpause();
 }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:00:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725370#M5068</guid>
      <dc:creator>StephenQuan</dc:creator>
      <dc:date>2021-12-12T07:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Map went blank after rotation</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725371#M5069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having this same issue. I have the "onPause" and "onResume" methods but my map is still being cleared after rotating the device. This is not good since doing so calls onCreate once again and my map loading process is a little too expensive to be repeating.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HELP!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 07:11:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725371#M5069</guid>
      <dc:creator>EDWINSANCHEZ</dc:creator>
      <dc:date>2012-03-16T07:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Map went blank after rotation</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725372#M5070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;have a look at this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/52750-Rotation-changes-map-extent" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/52750-Rotation-changes-map-extent&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As i stated there:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There is also the NOT recommended way of your activity just not acting on the rotation change.&lt;BR /&gt;Would look something like this.&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;activity android:name="YourMapActivity" android:configChanges="keyboardHidden|orientation"&amp;gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm doing the same in my app because of the loading expenses. Sometimes you have to work a little against the recommendations...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725372#M5070</guid>
      <dc:creator>SimonKlein</dc:creator>
      <dc:date>2021-12-12T07:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Map went blank after rotation</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725373#M5071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please explain me, what are you discussing about?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgismobile/10.0/apis/android/help/0119/01190000002n000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Map Rotation&lt;/A&gt;&lt;SPAN&gt; or (2) device flipping (and map rotation as result of it)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) - Clear - it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(2) - Need to write code around it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance()" rel="nofollow noopener noreferrer" target="_blank"&gt;onRetainNonConfigurationInstance()&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;NB! This method is deprecated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public void onCreate(Bundle savedInstanceState) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapView = (MapView) findViewById(R.id.map);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object[] init = (Object[]) getLastNonConfigurationInstance();
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (init != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapView.restoreState((String) init[0]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tiledMapServiceLayer = (ArcGISTiledMapServiceLayer) init[1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer = (GraphicsLayer) init[2];
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapView.setExtent(new Envelope(-85.61828847183895, 38.19242311866144, -85.53589100936443, 38.31361605305102));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tiledMapServiceLayer = new ArcGISTiledMapServiceLayer(this, mapURL);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer = new GraphicsLayer(this);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; // ...
}
// ...
public Object onRetainNonConfigurationInstance() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object appState = new Object[] { mapView.retainState(), tiledMapServiceLayer, graphicsLayer };
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapView.removeAll();

&amp;nbsp;&amp;nbsp;&amp;nbsp; return appState;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean)" rel="nofollow noopener noreferrer" target="_blank"&gt;setRetainInstance(boolean)&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;We has no time to try it ... So, when you solve problem paste your code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. &lt;/SPAN&gt;&lt;A href="http://proceedings.esri.com/library/userconf/devsummit11/papers/tech/advanced_development_with_arcgis_api_for_android.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;This link&lt;/A&gt;&lt;SPAN&gt; (PDF) as bonus (contains link to WaterServiceApplication sample)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/map-went-blank-after-rotation/m-p/725373#M5071</guid>
      <dc:creator>IvanBespalov</dc:creator>
      <dc:date>2021-12-12T07:01:04Z</dc:date>
    </item>
  </channel>
</rss>

