AnsweredAssumed Answered

TileCache listeners never called

Question asked by henrou on Feb 3, 2017
Latest reply on Feb 14, 2017 by henrou



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?


Here is the code


File baseMap = getPermanentPathForMapType(MapDataType.BASE_MAP);
TileCache tileCache = new TileCache(baseMap.getPath());
tileCache.addDoneLoadingListener(new Runnable() {
public void run() {
        Log.i(TAG, "LOAD DONE"); // Sometimes not called
tileCache.addLoadStatusChangedListener(new LoadStatusChangedListener() {
public void loadStatusChanged(LoadStatusChangedEvent loadStatusChangedEvent) {
        Log.i(TAG, "LOAD STATUS CHANGED TO " + loadStatusChangedEvent.getNewLoadStatus().toString()); // Sometimes not called
Log.i(TAG, tileCache.getLoadStatus().toString()); // LOADING