From ed92beaae065631b29fb21dc18dab21aab7eda2f Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Wed, 11 Oct 2023 10:45:04 -0600 Subject: [PATCH] fix for geometry count --- .../java/mil/nga/mapcache/MapFeaturesUpdateTask.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mapcache/src/main/java/mil/nga/mapcache/MapFeaturesUpdateTask.java b/mapcache/src/main/java/mil/nga/mapcache/MapFeaturesUpdateTask.java index 200992df..481357f6 100644 --- a/mapcache/src/main/java/mil/nga/mapcache/MapFeaturesUpdateTask.java +++ b/mapcache/src/main/java/mil/nga/mapcache/MapFeaturesUpdateTask.java @@ -346,9 +346,9 @@ private void displayFeatures(GeoPackage geoPackage, StyleCache styleCache, Strin + ", row: " + cursor.getPosition(), e); } } - if(getErrorCount() > 0){ + int totalErrors = getErrorCount(); + if(totalErrors > 0){ new Handler(Looper.getMainLooper()).post(() -> { - Toast toast = Toast.makeText(activity, "Error loading geometry", Toast.LENGTH_SHORT); toast.show(); }); @@ -404,9 +404,10 @@ private void processFeatureIndexResults(FeatureIndexResults indexResults, String } } finally { indexResults.close(); - if(getErrorCount() > 0){ + int totalErrors = getErrorCount(); + if(totalErrors > 0){ new Handler(Looper.getMainLooper()).post(() -> { - Toast toast = Toast.makeText(activity, getErrorCount() + " Geometries failed to load", Toast.LENGTH_SHORT); + Toast toast = Toast.makeText(activity, totalErrors + " Geometries failed to load", Toast.LENGTH_SHORT); toast.show(); }); setErrorCount(0);