From da01f6010ddaa03bb508f9a590ef92805db10651 Mon Sep 17 00:00:00 2001 From: David-Development Date: Sat, 30 Aug 2014 16:05:39 +0200 Subject: [PATCH] Fix issue that if the sync fails a wrong new item number is shown --- .../reader/owncloud/AsyncTask_GetItems.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/owncloud/AsyncTask_GetItems.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/owncloud/AsyncTask_GetItems.java index faefd5fa..0fcf82be 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/owncloud/AsyncTask_GetItems.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/owncloud/AsyncTask_GetItems.java @@ -112,10 +112,12 @@ public class AsyncTask_GetItems extends AsyncTask_Reader { } else { + //First reset the count of last updated items + mPrefs.edit().putInt(Constants.LAST_UPDATE_NEW_ITEMS_COUNT_STRING, 0).commit(); + //Get all updated items int[] result = api.GetUpdatedItems(TAGS.ALL, context, lastModified + 1, api); + //If no exception occurs, set the number of updated items mPrefs.edit().putInt(Constants.LAST_UPDATE_NEW_ITEMS_COUNT_STRING, result[1]).commit(); - - //OwnCloudReaderMethods.GetUpdatedItems(TAGS.ALL, context, lastModified, api); } } catch (Exception ex) { ex.printStackTrace();