<?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 GraphicsLayer problem in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphicslayer-problem/m-p/107850#M787</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;BR /&gt;&lt;SPAN&gt;I am having a problem with my GraphicsLayer. I open a MapView and add a graphic when the user taps the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is also functionality to change the base map. If the user stays on the initial base map, the graphics display properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if the user changes the base map, the graphics are not displayed. I put a breakpoint in my code to verify the graphics still exist in the layer and the layer is still in the map (it is the last layer in the map).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my reorder code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
 private void orderArcmap(Boolean isChangeBase) {

&amp;nbsp; int startPoint;
&amp;nbsp; 
&amp;nbsp; if (isChangeBase) {
&amp;nbsp;&amp;nbsp; arcMap.removeAll();
&amp;nbsp;&amp;nbsp; startPoint = 0;
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; while (arcMap.getLayers().length &amp;gt; 1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcMap.removeLayer(arcMap.getLayers().length - 1);
&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp; startPoint = 1;
&amp;nbsp; }

&amp;nbsp; for (int i = startPoint; i &amp;lt; 4; i++) {
&amp;nbsp;&amp;nbsp; for (Map.Entry&amp;lt;Layer, Integer&amp;gt; entry : layerMap.entrySet()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (entry.getValue() == i) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcMap.addLayer(entry.getKey());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }

&amp;nbsp; arcMap.addLayer(arcGisGraphicLayers);
&amp;nbsp; arcMap.refreshDrawableState();
&amp;nbsp; arcMap.postInvalidate();
 }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas where I should look to fix my problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JR&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2014 20:06:58 GMT</pubDate>
    <dc:creator>JoeRadjavitch</dc:creator>
    <dc:date>2014-01-30T20:06:58Z</dc:date>
    <item>
      <title>GraphicsLayer problem</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphicslayer-problem/m-p/107850#M787</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;BR /&gt;&lt;SPAN&gt;I am having a problem with my GraphicsLayer. I open a MapView and add a graphic when the user taps the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is also functionality to change the base map. If the user stays on the initial base map, the graphics display properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if the user changes the base map, the graphics are not displayed. I put a breakpoint in my code to verify the graphics still exist in the layer and the layer is still in the map (it is the last layer in the map).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my reorder code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
 private void orderArcmap(Boolean isChangeBase) {

&amp;nbsp; int startPoint;
&amp;nbsp; 
&amp;nbsp; if (isChangeBase) {
&amp;nbsp;&amp;nbsp; arcMap.removeAll();
&amp;nbsp;&amp;nbsp; startPoint = 0;
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; while (arcMap.getLayers().length &amp;gt; 1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcMap.removeLayer(arcMap.getLayers().length - 1);
&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp; startPoint = 1;
&amp;nbsp; }

&amp;nbsp; for (int i = startPoint; i &amp;lt; 4; i++) {
&amp;nbsp;&amp;nbsp; for (Map.Entry&amp;lt;Layer, Integer&amp;gt; entry : layerMap.entrySet()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (entry.getValue() == i) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcMap.addLayer(entry.getKey());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }

&amp;nbsp; arcMap.addLayer(arcGisGraphicLayers);
&amp;nbsp; arcMap.refreshDrawableState();
&amp;nbsp; arcMap.postInvalidate();
 }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas where I should look to fix my problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JR&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 20:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphicslayer-problem/m-p/107850#M787</guid>
      <dc:creator>JoeRadjavitch</dc:creator>
      <dc:date>2014-01-30T20:06:58Z</dc:date>
    </item>
  </channel>
</rss>

