<?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: Feature not drawing after added to offline database, refresh map? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/feature-not-drawing-after-added-to-offline/m-p/98199#M733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case anyone is having this issue or has it in the future. I Revisited this problem after some time and fixed it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was due to architecture issues, and was solved by creating a global variable of a Geodatabase and always using that variable for database operations.&amp;nbsp; Previously I was creating new instances of a geodatabase and using that for inserts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is what I do now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;static Geodatabase localGDB; //declare global variable in main activity

localGDB = new Geodatabase("path/to/local/my.geodatabase"); //instantiate geodatabase in on create or elsewhere

MyActivityWithGlobalVar.localGDB //reference localGDB variable in other activities in this way when doing anything to it&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:08:22 GMT</pubDate>
    <dc:creator>ForrestKaye</dc:creator>
    <dc:date>2021-12-11T06:08:22Z</dc:date>
    <item>
      <title>Feature not drawing after added to offline database, refresh map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/feature-not-drawing-after-added-to-offline/m-p/98198#M732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I cannot get a new feature to draw immediately after I add it to the offline geodatabase I am using.&amp;nbsp; (It will draw once I pan or zoom) I am looking for a refresh() call but can't find any reference to it.&amp;nbsp; I saw &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/46408-Dynamic-layer-does-not-load-or-only-after-device-rotation?highlight=refresh" rel="nofollow noopener noreferrer" target="_blank"&gt;this thread&lt;/A&gt;&lt;SPAN&gt; that seems similar and references a refresh() but I can't find it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am assuming what ever call is necessary to refresh the map drawing I should place it in the onResume() call?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; @Override
&amp;nbsp; protected void onResume() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onResume();

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Call MapView.unpause to resume map rendering when the activity returns to the foreground.
&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.unpause();

&amp;nbsp;&amp;nbsp; //refresh map/layers here?
&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/feature-not-drawing-after-added-to-offline/m-p/98198#M732</guid>
      <dc:creator>ForrestKaye</dc:creator>
      <dc:date>2021-12-11T06:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Feature not drawing after added to offline database, refresh map?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/feature-not-drawing-after-added-to-offline/m-p/98199#M733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case anyone is having this issue or has it in the future. I Revisited this problem after some time and fixed it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was due to architecture issues, and was solved by creating a global variable of a Geodatabase and always using that variable for database operations.&amp;nbsp; Previously I was creating new instances of a geodatabase and using that for inserts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is what I do now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;static Geodatabase localGDB; //declare global variable in main activity

localGDB = new Geodatabase("path/to/local/my.geodatabase"); //instantiate geodatabase in on create or elsewhere

MyActivityWithGlobalVar.localGDB //reference localGDB variable in other activities in this way when doing anything to it&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:08:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/feature-not-drawing-after-added-to-offline/m-p/98199#M733</guid>
      <dc:creator>ForrestKaye</dc:creator>
      <dc:date>2021-12-11T06:08:22Z</dc:date>
    </item>
  </channel>
</rss>

