<?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: TileCache listeners never called in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284747#M1894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hi Alexander,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Yes I have but unfortunately&amp;nbsp;it doesn't&amp;nbsp;make a difference. And it shouldn't, according to&amp;nbsp;the docs. If the cache has already loaded when the listener is added the DoneLoadingListener method (run) should be called immediately.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Since the loading failed randomly I'm leaning towards it being a timing issue of some kind. What I did as a workaround was to create a separate class that repeatedly attempts to load the cache in the background until succeeding.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Regards&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Feb 2017 11:07:58 GMT</pubDate>
    <dc:creator>HenrikPierrou</dc:creator>
    <dc:date>2017-02-14T11:07:58Z</dc:date>
    <item>
      <title>TileCache listeners never called</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284745#M1892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Hi,&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;In my app using ArcGIS Runtime SDK for Android 100.0.0 I’m loading a local TileCache from a TPK file into my MapView as a basemap. Before loading the TileCache I’m adding a “DoneLoadingListener” (Runnable) and a LoadStatusChangedListener to the TileCache to get notified when the loading is done. It is my understanding that these listeners should be called whether the loading succeeds or not and that by checking the LoadStatus on the TileCache I can tell if it loaded successfully or not. On some occasions though, seemingly randomly, the callbacks aren’t called at all. What may cause the callbacks to not be called and how can I monitor what is going on if I can’t get notified using the listeners?&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;Here is the code&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;File baseMap = &lt;EM&gt;getPermanentPathForMapType&lt;/EM&gt;(MapDataType.&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;EM&gt;BASE_MAP&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;BR /&gt; TileCache tileCache = &lt;SPAN class=""&gt;&lt;STRONG&gt;new &lt;/STRONG&gt;&lt;/SPAN&gt;TileCache(baseMap.getPath());&lt;BR /&gt; tileCache.loadAsync();&lt;BR /&gt; tileCache.addDoneLoadingListener(&lt;SPAN class=""&gt;&lt;STRONG&gt;new &lt;/STRONG&gt;&lt;/SPAN&gt;Runnable() {&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;@Override&lt;BR /&gt; &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;public void &lt;/STRONG&gt;&lt;/SPAN&gt;run() {&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Log.&lt;EM&gt;i&lt;/EM&gt;(&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;EM&gt;TAG&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN class=""&gt;&lt;STRONG&gt;"LOAD DONE"&lt;/STRONG&gt;&lt;/SPAN&gt;); // Sometimes not called&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt; });&lt;BR /&gt; tileCache.addLoadStatusChangedListener(&lt;SPAN class=""&gt;&lt;STRONG&gt;new &lt;/STRONG&gt;&lt;/SPAN&gt;LoadStatusChangedListener() {&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;@Override&lt;BR /&gt; &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;public void &lt;/STRONG&gt;&lt;/SPAN&gt;loadStatusChanged(LoadStatusChangedEvent loadStatusChangedEvent) {&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Log.&lt;EM&gt;i&lt;/EM&gt;(&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;EM&gt;TAG&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN class=""&gt;&lt;STRONG&gt;"LOAD STATUS CHANGED TO " &lt;/STRONG&gt;&lt;/SPAN&gt;+ loadStatusChangedEvent.getNewLoadStatus().toString()); // Sometimes not called&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt; });&lt;BR /&gt; Log.&lt;EM&gt;i&lt;/EM&gt;(&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;EM&gt;TAG&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;, tileCache.getLoadStatus().toString()); // LOADING&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;Regards,&lt;/P&gt;&lt;P class=""&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2017 18:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284745#M1892</guid>
      <dc:creator>HenrikPierrou</dc:creator>
      <dc:date>2017-02-03T18:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: TileCache listeners never called</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284746#M1893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried moving the loadAsync() method to below the StatusChangedListeners?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284746#M1893</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-02-10T18:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: TileCache listeners never called</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284747#M1894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hi Alexander,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Yes I have but unfortunately&amp;nbsp;it doesn't&amp;nbsp;make a difference. And it shouldn't, according to&amp;nbsp;the docs. If the cache has already loaded when the listener is added the DoneLoadingListener method (run) should be called immediately.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Since the loading failed randomly I'm leaning towards it being a timing issue of some kind. What I did as a workaround was to create a separate class that repeatedly attempts to load the cache in the background until succeeding.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Regards&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2017 11:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/tilecache-listeners-never-called/m-p/284747#M1894</guid>
      <dc:creator>HenrikPierrou</dc:creator>
      <dc:date>2017-02-14T11:07:58Z</dc:date>
    </item>
  </channel>
</rss>

