aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java8
-rw-r--r--main/src/cgeo/geocaching/cgCache.java5
-rw-r--r--main/src/cgeo/geocaching/cgData.java11
3 files changed, 10 insertions, 14 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index 29c8934..a341333 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -335,9 +335,6 @@ public class CacheDetailActivity extends AbstractActivity {
if (geolocation == null) {
geolocation = app.startGeo(locationUpdater);
}
- if (cache != null) {
- cache.setChangeNotificationHandler(cacheChangeNotificationHandler);
- }
if (refreshOnResume) {
notifyDataSetChanged();
refreshOnResume = false;
@@ -634,6 +631,11 @@ public class CacheDetailActivity extends AbstractActivity {
// Data loaded, we're ready to show it!
notifyDataSetChanged();
+ // cache isn't available until after notifyDataSetChanged is called
+ if (cache != null) {
+ cache.setChangeNotificationHandler(cacheChangeNotificationHandler);
+ }
+
}
}
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index e308209..f7d503e 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -436,12 +436,13 @@ public class cgCache implements ICache {
cgeoapplication app = (cgeoapplication) ((Activity) fromActivity).getApplication();
final boolean status = app.saveLogOffline(geocode, date.getTime(), logType, log);
- notifyChange();
-
Resources res = ((Activity) fromActivity).getResources();
if (status) {
fromActivity.showToast(res.getString(R.string.info_log_saved));
app.saveVisitDate(geocode);
+ logOffline = true;
+
+ notifyChange();
} else {
fromActivity.showToast(res.getString(R.string.err_log_post_failed));
}
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java
index 2c7a88b..3812601 100644
--- a/main/src/cgeo/geocaching/cgData.java
+++ b/main/src/cgeo/geocaching/cgData.java
@@ -3188,15 +3188,8 @@ public class cgData {
try {
ContentValues values = new ContentValues();
values.put("visiteddate", visitedDate);
- int rows = databaseRW.update(dbTableCaches, values, "geocode = ?", new String[] { geocode });
- if (rows > 0) {
- // update CacheCache
- cgCache cache = cacheCache.getCacheFromCache(geocode);
- if (cache != null) {
- cache.setFound(true);
- cacheCache.putCacheInCache(cache);
- }
- }
+
+ databaseRW.update(dbTableCaches, values, "geocode = ?", new String[] { geocode });
databaseRW.setTransactionSuccessful();
} finally {
databaseRW.endTransaction();