<?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 Switching basemaps in Android app not working properly in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477680#M3282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have a problem with switching basemaps in our Android app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have two different types of basemaps &lt;SPAN style="font-family: helvetica; color: #606060;"&gt;(both are ArcGISTiledMapServiceLayers, based on MapServices published to our ArcGIS Server).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially, the map is loaded with the first basemap (basemapOne) on top of it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ArcGISTiledMapServiceLayer baseMapOne = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISTiledMapServiceLayer(basemapURL1);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.addLayer(baseMapOne);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the user can toggle a switch to change to the other basemap.&lt;/P&gt;&lt;P&gt;We have implemented this as follows (layer number 0 is the first layer, i.e. the basemap):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #660e7a;"&gt;map&lt;/SPAN&gt;.getLayer(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;).recycle();&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #660e7a;"&gt;map&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;);&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (...basemapOne was switched on....) {&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #606060;"&gt;map.addLayer(new ArcGISTiledMapServiceLayer(basemapURL1), 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #606060;"&gt;} else { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #606060;"&gt;map.addLayer(new ArcGISTiledMapServiceLayer(basemapURL2), 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #606060;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes this works without problems, especially if we only just started the app. But if we then, for example, press the home button and thus pause the map, reopen it, and try to switch the basemap, nothing happens - the basemap we try to remove remains visible. Sometimes, we can see a few single tiles of the second basemap "shining through" , but that's all. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that helps in this case is to clear the app from memory, or to completely close it by using the back button. If we then open it again, switching basemaps usually works again (but sometimes not even then). It seems that the old tiles are still cached somehow, or not cleared from memory when calling "map.removeLayer". Or could it have to do with the fact that we use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;getSharedPreferences(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"mapPreference"&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;).edit().putString(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"mapState"&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.retainState()).apply();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to save the map state in onPause(), and &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.restoreState(mapState) in onResume ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, the same problem appears if we don't use "removeLayer" and "addLayer" but instead setVisibility(true/false). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to solve the problems? Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2016 15:15:03 GMT</pubDate>
    <dc:creator>LageplanGöttingen</dc:creator>
    <dc:date>2016-07-27T15:15:03Z</dc:date>
    <item>
      <title>Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477680#M3282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have a problem with switching basemaps in our Android app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have two different types of basemaps &lt;SPAN style="font-family: helvetica; color: #606060;"&gt;(both are ArcGISTiledMapServiceLayers, based on MapServices published to our ArcGIS Server).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially, the map is loaded with the first basemap (basemapOne) on top of it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ArcGISTiledMapServiceLayer baseMapOne = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISTiledMapServiceLayer(basemapURL1);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.addLayer(baseMapOne);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the user can toggle a switch to change to the other basemap.&lt;/P&gt;&lt;P&gt;We have implemented this as follows (layer number 0 is the first layer, i.e. the basemap):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #660e7a;"&gt;map&lt;/SPAN&gt;.getLayer(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;).recycle();&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #660e7a;"&gt;map&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;);&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (...basemapOne was switched on....) {&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #606060;"&gt;map.addLayer(new ArcGISTiledMapServiceLayer(basemapURL1), 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #606060;"&gt;} else { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #606060;"&gt;map.addLayer(new ArcGISTiledMapServiceLayer(basemapURL2), 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #606060;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes this works without problems, especially if we only just started the app. But if we then, for example, press the home button and thus pause the map, reopen it, and try to switch the basemap, nothing happens - the basemap we try to remove remains visible. Sometimes, we can see a few single tiles of the second basemap "shining through" , but that's all. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing that helps in this case is to clear the app from memory, or to completely close it by using the back button. If we then open it again, switching basemaps usually works again (but sometimes not even then). It seems that the old tiles are still cached somehow, or not cleared from memory when calling "map.removeLayer". Or could it have to do with the fact that we use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;getSharedPreferences(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"mapPreference"&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;).edit().putString(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"mapState"&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.retainState()).apply();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to save the map state in onPause(), and &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.restoreState(mapState) in onResume ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, the same problem appears if we don't use "removeLayer" and "addLayer" but instead setVisibility(true/false). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to solve the problems? Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 15:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477680#M3282</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2016-07-27T15:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477681#M3283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not believe that retainState is the issue here as according to the documentation, it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/MapView.html#retainState()" title="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/MapView.html#retainState()"&gt;MapView | ArcGIS Android 10.2.8 API&lt;/A&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;Saves the coordinates of the center of the map, the current map resolution, and the LocationDisplayManager state"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should not affect the layers that are showing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;Is there a chance that an app with a higher priority that needs memory is recycling your app and you are going back to the onCreate method or is it possible that your app is hitting onRestart and then onStart since the activity may no longer be visible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;Here is a copy of the activity lifecycle again for reference:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;IMG alt="State diagram for an Android Activity Lifecycle." class="jive-image" src="https://developer.android.com/images/activity_lifecycle.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 15:53:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477681#M3283</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-07-27T15:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477682#M3284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We just checked it again, but the problem indeed mostly happens after "onResume" is called, not after "onStart" or "onCreate".&amp;nbsp; &lt;/P&gt;&lt;P&gt;It happens even if there is still a lot of free memory available and no other apps are open. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 09:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477682#M3284</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2016-07-28T09:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477683#M3285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/221993"&gt;Lageplan Göttingen&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That seems odd.&amp;nbsp; Can you send me the smallest reproducible sample so I may test here in house and update you with the results I see?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 12:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477683#M3285</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-07-28T12:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477684#M3286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I have written a small example application that shows one of our basemaps, and if you click on the button, it switches to the other basemap. Again, this works well until I press the home button. If I then reopen the app (which was not destroyed, just paused), I can no longer switch basemaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can download the Android Studio project here: &lt;A href="http://www.filedropper.com/switchbasemap" title="http://www.filedropper.com/switchbasemap"&gt;http://www.filedropper.com/switchbasemap&lt;/A&gt; &lt;/P&gt;&lt;P&gt;It only contains one activity, "BasemapActivity". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If for some reason you cannot compile the app from the source code I provided, please let me know and I can send you a signed APK file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 13:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477684#M3286</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2016-07-28T13:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477685#M3287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am in the process of downloading the file as we speak.&amp;nbsp; I will update you as available.&amp;nbsp; I am in training the next two days so it may be a little difficult to find the time to test this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 16:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477685#M3287</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-07-28T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477686#M3288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have noticed that your onResume does not account for any existing layers in the map.&amp;nbsp; Therefore, you were adding a layer over top of your baselayer.&amp;nbsp; I went and added a small check and this seemed to resolve the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #bbb529;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;public void &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;onResume&lt;/SPAN&gt;() {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832;"&gt;super&lt;/SPAN&gt;.onResume()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Log.&lt;SPAN style="font-style: italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;"SwitchBasemap"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"onResume"&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ArcGISTiledMapServiceLayer baseMap = &lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;ArcGISTiledMapServiceLayer(getString(R.string.&lt;SPAN style="color: #9876aa; font-style: italic;"&gt;basemapURL1&lt;/SPAN&gt;))&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map &lt;/SPAN&gt;= (MapView) findViewById(R.id.&lt;SPAN style="color: #9876aa; font-style: italic;"&gt;map&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.unpause()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.setAllowRotationByPinch(&lt;SPAN style="color: #cc7832;"&gt;true&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.setMaxExtent(&lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;Envelope(&lt;SPAN style="color: #6897bb;"&gt;1102008.94&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;6711653.74&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;1110493.45&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;6723119.29&lt;/SPAN&gt;))&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.&lt;SPAN style="background-color: #344134;"&gt;setMinScale&lt;/SPAN&gt;(&lt;SPAN style="color: #6897bb;"&gt;35000&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp; if &lt;/SPAN&gt;(&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.getLayers().&lt;SPAN style="color: #9876aa;"&gt;length &lt;/SPAN&gt;&amp;gt; &lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;) {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.addLayer(baseMap&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832;"&gt;else &lt;/SPAN&gt;{
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #9876aa;"&gt;map&lt;/SPAN&gt;.addLayer(baseMap&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}



}&lt;/PRE&gt;&lt;P&gt;Please let me know if this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477686#M3288</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2021-12-11T21:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Switching basemaps in Android app not working properly</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477687#M3289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great!! This solved our problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 07:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/switching-basemaps-in-android-app-not-working/m-p/477687#M3289</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2016-07-29T07:06:25Z</dc:date>
    </item>
  </channel>
</rss>

