<?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: AddLayer after OnCreate NOT working. BUG? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242604#M1588</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;BR /&gt;&lt;SPAN&gt;Actually, yes, I'm pretty sure the layer is indeed initialized. After the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp;&amp;nbsp; mMapView.removeAll();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapTopo);[/INDENT] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I get the layers added to the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Layer[] list = mMapView.getLayers();[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I check all the properties, I'm getting the following log with my samsung galaxy ace (the one which is not working)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getHeight():430&lt;BR /&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getID():2236624&lt;BR /&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getMaxScale():0.0&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getMinScale():0.0&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getName():Layers&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getOpacity():1.0&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getResolution():125234.41916976124&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getTitle():null&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getUrl():&lt;A href="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"&gt;http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getWebMapLayerID():null&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getWidth():320&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getDefaultSpatialReference()com.esri.core.geometry.SpatialReference@4057f900&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.isInitialized():true&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.isVisible():true&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getHeight()false&lt;/SPAN&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the same values (except the ones relative to the screen resolution, etc) for my samsung galaxy s3, where the code works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The map getVisibility is the correct one too (value 0 = VISIBLE).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I mean, everything looks like it has to work. The map is initialized, the layer too, and it seems that is properly added to the map... but, for some reason, is not being rendered in the device... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone from ESRI could confirm that this should work, and try to check it by himself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 12:22:05 GMT</pubDate>
    <dc:creator>JessicaSena</dc:creator>
    <dc:date>2013-05-28T12:22:05Z</dc:date>
    <item>
      <title>AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242597#M1581</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;BR /&gt;&lt;SPAN&gt;I'm experimenting a weird behaviour with map.addLayer() method and I'm not sure if it's a bug or I'm missing something.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The thing is that in some Android devices (i.e. Samsung Galaxy Ace) when I add layers to the map after the OnCreate method these layers are not showing in the map, but if I add the layers during the onCreate method, these layers are showing correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could guess that you can only use the addLayer method on the OnCreate process, but it has no sense because as I say, this only happens in some Android devices... and that's why I'm not getting which is the exact problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These are two examples about 2different ways of how I add the layers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;map.removeAll(); &lt;BR /&gt;&lt;SPAN&gt;WMSLayer wms = new WMSLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://mapcache.icc.cat/map/bases/service" rel="nofollow" target="_blank"&gt;http://mapcache.icc.cat/map/bases/service&lt;/A&gt;&lt;SPAN&gt;?",SpatialReference.create(23031));&lt;/SPAN&gt;&lt;BR /&gt;map.addLayer(wms);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;baseLayer.setVisible(false);//I set to not visible the current layer added to the map&lt;BR /&gt;&lt;SPAN&gt;WMSLayer wms = new WMSLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://mapcache.icc.catmapbasesservice" rel="nofollow" target="_blank"&gt;http://mapcache.icc.catmapbasesservice&lt;/A&gt;&lt;SPAN&gt;?",SpatialReference.create(23031));&lt;/SPAN&gt;&lt;BR /&gt;map.addLayer(wms);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone has noticed the same? Anyone from ESRI could try to reproduce the problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advanced,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 08:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242597#M1581</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-13T08:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242598#M1582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then, nobody else has experimented the same issue? I've been doing some more research with no luck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I download de BaseMaps example, given by ESRI, where they only add 4base layers to the mapn in the onCreate, and then they only change the visibility of each depending on which one you choose. I've modified this to use the "add" and "remove" map operations, instead of addind all layers in the on Create and going on changing the visibility, and indeed, it doesn't work neither in my samsung galaxy ace:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//In the original code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case R.id.World_Topo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemapStreet.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//In my code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case R.id.World_Topo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mMapView.removeAll();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapTopo);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And, misteriously (at least for me) the second snippet doesn't work in some devices. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, could anyone give me some advice of how to solve it? Is it normal? Is it impossible to add/remove layers dynamically? or I have to assume that you have to manage the layers of the map in a kinf od "static way" knowing from the begining all the layers you're going to use?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 06:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242598#M1582</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-28T06:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242599#M1583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please post how your MapView was created. Did you added it to your layout.xml?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Normally a layer is shown after it has been added to a mapview. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you also set the extent of your map view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think, it would be a good idea to post your complete code so I could check it myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 07:02:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242599#M1583</guid>
      <dc:creator>KevinGebhardt</dc:creator>
      <dc:date>2013-05-28T07:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242600#M1584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, of course! Here's the code of the example "Basemaps" provided for ESRI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;public class BasemapsActivity extends Activity {&lt;BR /&gt;&lt;BR /&gt;[INDENT] MapView mMapView = null;&lt;BR /&gt; ArcGISTiledMapServiceLayer basemapStreet;&lt;BR /&gt; ArcGISTiledMapServiceLayer basemapTopo;&lt;BR /&gt; ArcGISTiledMapServiceLayer basemapNatGeo;&lt;BR /&gt; ArcGISTiledMapServiceLayer basemapOcean;[/INDENT]&lt;BR /&gt;&lt;BR /&gt; /** Called when the activity is first created. */&lt;BR /&gt; @Override&lt;BR /&gt; public void onCreate(Bundle savedInstanceState) {&lt;BR /&gt;[INDENT]&amp;nbsp; super.onCreate(savedInstanceState);&lt;BR /&gt;&amp;nbsp; setContentView(R.layout.main);&lt;BR /&gt;&amp;nbsp; // Retrieve the map and initial extent from XML layout&lt;BR /&gt;&amp;nbsp; mMapView = (MapView) findViewById(R.id.map);&lt;BR /&gt;&amp;nbsp; /* create an initial basemap */&lt;BR /&gt;&amp;nbsp; basemapStreet = new ArcGISTiledMapServiceLayer(this.getResources()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getString(R.string.WORLD_STREET_MAP));&lt;BR /&gt;&amp;nbsp; basemapTopo = new ArcGISTiledMapServiceLayer(this.getResources()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getString(R.string.WORLD_TOPO_MAP));&lt;BR /&gt;&amp;nbsp; basemapNatGeo = new ArcGISTiledMapServiceLayer(this.getResources()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getString(R.string.WORLD_NATGEO_MAP));&lt;BR /&gt;&amp;nbsp; basemapOcean = new ArcGISTiledMapServiceLayer(this.getResources()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getString(R.string.OCEAN_BASEMAP));&lt;BR /&gt;&amp;nbsp; // set visibility&lt;BR /&gt;&amp;nbsp; basemapTopo.setVisible(false);&lt;BR /&gt;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;BR /&gt;&amp;nbsp; basemapOcean.setVisible(false);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // attribute ESRI logo to map&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.setEsriLogoVisible(true); [/INDENT] &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;[INDENT]&amp;nbsp; // Add basemap to MapView&lt;BR /&gt;&amp;nbsp; mMapView.addLayer(basemapStreet);&lt;BR /&gt;&amp;nbsp; mMapView.addLayer(basemapTopo);&lt;BR /&gt;&amp;nbsp; mMapView.addLayer(basemapNatGeo);&lt;BR /&gt;&amp;nbsp; mMapView.addLayer(basemapOcean);[/INDENT]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // enable map to wrap around date line&lt;BR /&gt;&amp;nbsp; mMapView.enableWrapAround(true);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; public boolean onCreateOptionsMenu(Menu menu) {&lt;BR /&gt;[INDENT]&amp;nbsp; MenuInflater inflater = getMenuInflater();&lt;BR /&gt;&amp;nbsp; inflater.inflate(R.menu.basemap_menu, menu);&lt;BR /&gt;&amp;nbsp; return true;[/INDENT]&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; public boolean onOptionsItemSelected(MenuItem item) {&lt;BR /&gt;[INDENT]&amp;nbsp; // handle item selection&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; switch (item.getItemId()) {&lt;BR /&gt;&amp;nbsp; case R.id.World_Street_Map:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [INDENT]basemapStreet.setVisible(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return true;[/INDENT]&lt;BR /&gt;&amp;nbsp; case R.id.World_Topo:&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; [INDENT]basemapStreet.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return true;[/INDENT]&lt;BR /&gt;&amp;nbsp; case R.id.NatGeo:&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; [INDENT]basemapStreet.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return true;[/INDENT]&lt;BR /&gt;&amp;nbsp; case R.id.Ocean_Basemap:&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; [INDENT]basemapStreet.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(true);[/INDENT]&lt;BR /&gt;&amp;nbsp; default:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; [INDENT]return super.onOptionsItemSelected(item);[/INDENT][/INDENT]&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @Override&lt;BR /&gt; protected void onPause() {&lt;BR /&gt;[INDENT]&amp;nbsp; super.onPause();&lt;BR /&gt;&amp;nbsp; mMapView.pause();[/INDENT]&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @Override&lt;BR /&gt; protected void onResume() {&lt;BR /&gt;[INDENT]&amp;nbsp; super.onResume();&lt;BR /&gt;&amp;nbsp; mMapView.unpause();[/INDENT]&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, the point is, if I comment the "map.addLayer(X)" lines, in the onCreate (setting layers visibility to true), and in every case of the switch, instead of setting the visibility, I do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp; case R.id.World_Topo:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [INDENT]mMapView.removeAll();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapTopo);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//&amp;nbsp;&amp;nbsp; basemapStreet.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//&amp;nbsp;&amp;nbsp; basemapNatGeo.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//&amp;nbsp;&amp;nbsp; basemapOcean.setVisible(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//&amp;nbsp;&amp;nbsp; basemapTopo.setVisible(true);[/INDENT][/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that means, I remove all the possible layers in the map and I add a new one, for some devices the new layer is not showing. I've tested with diffetent combinations of adding and removing layers and the problem persists. I've tested not doing a "remove" or removeAll", only the "add", and it doesn't work neither (with this I mean, that I guess that the remove is not the problem) I've only solved the issue adding all the layers in the onCreate... but that would mean that you can't add layers dynamically to your map... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea what's going on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same code is working for the following devices:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung galaxy s3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sony ericsson st18i&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LG e610&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung galaxy TAB&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and not working for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung Galaxy ACE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung tab 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, hope somebody can help me&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 07:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242600#M1584</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-28T07:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242601#M1585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried your code on my Medion tablet with Android 4.0.3 and it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What are the android-versions of your tablets / smartphones?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the min- and the max-SDK property in the AndroidManifest.xml set correctly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you see nothing at all or the empty grid of the tiled layers? Maybe it could help to zoom to a known location with &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mMapView.zoomToScale(yourCenter, yourScale);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 08:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242601#M1585</guid>
      <dc:creator>KevinGebhardt</dc:creator>
      <dc:date>2013-05-28T08:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242602#M1586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, thanks for trying!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The models and the android version they have are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;Devices where the code works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sony Ericsson st18i / 2.3.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sony Ericsson Xpersia P / 4.0.x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung Galaxy s3 / 4.1.x �?? 4.2.x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LG e610 / 4.1.x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung Galaxay Tab / 2.3.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Devices where DOESN'T work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsung galaxy note II / 3.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samsun galaxy Ace 2.3.6[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you see, it makes no sense neither... why the code is working in some devices and the others not?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've checked the min amb max version and it's ok:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;uses-sdk&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:minSdkVersion="8"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:targetSdkVersion="17" /&amp;gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About your question, I can see the grid, but not the layer... it seems that the "map" object is ok, but I don't understand why, th e layer is not being "painted"... I've tried to zoomtoscale in the map, changing map extent, and some other combinations with no luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really lost about it... any help will be grateful!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 09:54:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242602#M1586</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-28T09:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242603#M1587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It sounds like the layer could be initialized, otherwise you would not get the empty grid. Did you tried to display the scale and the center of the map in a textview. Can you get Attributes from the layers like getVisibility(), getExtent() or getLayers(). Check if you get any exceptions then you try to fetch these attributes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 10:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242603#M1587</guid>
      <dc:creator>KevinGebhardt</dc:creator>
      <dc:date>2013-05-28T10:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242604#M1588</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;BR /&gt;&lt;SPAN&gt;Actually, yes, I'm pretty sure the layer is indeed initialized. After the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp;&amp;nbsp; mMapView.removeAll();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapTopo);[/INDENT] &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I get the layers added to the map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Layer[] list = mMapView.getLayers();[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I check all the properties, I'm getting the following log with my samsung galaxy ace (the one which is not working)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getHeight():430&lt;BR /&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getID():2236624&lt;BR /&gt;05-28 14:38:06.210: I/BASEMAP(9888): l.getMaxScale():0.0&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getMinScale():0.0&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getName():Layers&lt;BR /&gt;05-28 14:38:06.242: I/BASEMAP(9888): l.getOpacity():1.0&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getResolution():125234.41916976124&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getTitle():null&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getUrl():&lt;A href="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"&gt;http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getWebMapLayerID():null&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getWidth():320&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getDefaultSpatialReference()com.esri.core.geometry.SpatialReference@4057f900&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.isInitialized():true&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.isVisible():true&lt;BR /&gt;05-28 14:38:06.273: I/BASEMAP(9888): l.getHeight()false&lt;/SPAN&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the same values (except the ones relative to the screen resolution, etc) for my samsung galaxy s3, where the code works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The map getVisibility is the correct one too (value 0 = VISIBLE).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I mean, everything looks like it has to work. The map is initialized, the layer too, and it seems that is properly added to the map... but, for some reason, is not being rendered in the device... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone from ESRI could confirm that this should work, and try to check it by himself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 12:22:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242604#M1588</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-28T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242605#M1589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I edited the Basemaps sample as you suggested in the post and cannot reproduce on a Galaxy Nexus or a Nexus 7 with Android 4.2.2 .&amp;nbsp; I am looking to see if I can find the specific devices you are referencing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Concerning your question about adding/removing layers ... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding all the layers and setting the visibility of the layer with Layer.setVisible() is the preferred approach as layers will be initialized once.&amp;nbsp; That is the reason the Basemaps samples uses that pattern.&amp;nbsp; However, if all of your layers share the same spatial reference you can instantiate the MapView with the Spatial Reference and Extent then add/remove any layers.&amp;nbsp; Is there a reason you prefer to add/remove layers over setting the visibility?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242605#M1589</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2013-05-28T18:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242606#M1590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Dan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First of all, thanks for answering and trying the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About your question, there are some reasons for which I prefer the add/remove behaviour:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- The less important, because I have many layers, and I was not sure about how many layers you could add to the map object without a loss of eficiency. Do you have any specific data about it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, the two more importants reasons are the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- In my app I want to offer the user the option to add "manually" layers to the map, that means, the user will be capable to write the URL, and the app will create the new layer with this URL, and then will add it to the map. And in the same way, after that, the user will be able to remove it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- I'm working with tpk's, and depending on the tpk's available in the device I will choose ones or anothers, that is, I don't know from the beginning which ones or how many I'll have. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To sum up, I need a dynamic behaviour about the layers in the map... I'm already using the "visibility pattern" for my base layers that always will be in the map, but I cannot do that for the others.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The worst thing is that I don't understand why the add/remove code does not work in some devices. And although you say that the preferred approach is setting the visibility, I assume that the add/remove should work too, otherwise which would be the point of add/remove operations?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advanced, and looking forward the results of your tests&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jessica&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 09:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242606#M1590</guid>
      <dc:creator>JessicaSena</dc:creator>
      <dc:date>2013-05-29T09:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayer after OnCreate NOT working. BUG?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242607#M1591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jessica for detailing your workflow and use case.&amp;nbsp; I can assure you that it is supported.&amp;nbsp; I tried to reproduce your issue on a Galaxy Note II with the specs below, but the app worked as expected.&amp;nbsp; Here is the code I used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 public boolean onOptionsItemSelected(MenuItem item) {
&amp;nbsp; // handle item selection
&amp;nbsp; switch (item.getItemId()) {
&amp;nbsp; case R.id.World_Street_Map:
&amp;nbsp;&amp;nbsp; mMapView.removeAll();
&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapStreet);&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp; case R.id.World_Topo:
&amp;nbsp;&amp;nbsp; mMapView.removeAll();
&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapTopo); 
&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp; case R.id.NatGeo:
&amp;nbsp;&amp;nbsp; mMapView.removeAll();
&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapNatGeo); 
&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp; case R.id.Ocean_Basemap:
&amp;nbsp;&amp;nbsp; mMapView.removeAll();
&amp;nbsp;&amp;nbsp; mMapView.addLayer(basemapOcean); 
&amp;nbsp; default:
&amp;nbsp;&amp;nbsp; return super.onOptionsItemSelected(item);
&amp;nbsp; }
 }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Device specs that I tested on:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hardware: Verizon Samsung Galaxy Note II&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Model number: SCH-I605&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Android version: 4.1.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Build number: JRO03C.I605VRALL4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kernel version: 3.0.31-414933 se.infra@SEP-79 #1 SMP PREEMPT Fri Dec 28 21:21:38 KST 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Android version is different and I suspect the kernel version will be as well.&amp;nbsp; The carrier is Verizon, what carrier are you using as there are some differences in carrier models.&amp;nbsp; This may have something to do with the issue as the fix may be in the device.&amp;nbsp; Is it possible for you to update to &lt;/SPAN&gt;&lt;A href="http://www.sammobile.com/2012/12/11/galaxy-note-ii-receives-android-4-1-2-jelly-bean-update-lots-of-new-features/" rel="nofollow noopener noreferrer" target="_blank"&gt;Android 4.1.2&lt;/A&gt;&lt;SPAN&gt; and see if that resolves it?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Concerning your workflow:&amp;nbsp; Have you created the option to manually add layers to the map with a user input URL?&amp;nbsp; That should work and I am interested in your experience.&amp;nbsp; We have a similar workflow in our &lt;/SPAN&gt;&lt;A href="https://play.google.com/store/apps/details?id=com.esri.android.client&amp;amp;feature=nav_result#?t=W251bGwsMSwyLDNd" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS App&lt;/A&gt;&lt;SPAN&gt; whereby users can input a URL to make a GIS Connection.&amp;nbsp; The ArcGIS App is wholly built with the SDK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/addlayer-after-oncreate-not-working-bug/m-p/242607#M1591</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2021-12-11T12:09:07Z</dc:date>
    </item>
  </channel>
</rss>

