Fix issue that if the sync fails a wrong new item number is shown
This commit is contained in:
parent
865f44a582
commit
da01f6010d
1 changed files with 4 additions and 2 deletions
|
@ -112,10 +112,12 @@ public class AsyncTask_GetItems extends AsyncTask_Reader {
|
||||||
}
|
}
|
||||||
else
|
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);
|
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();
|
mPrefs.edit().putInt(Constants.LAST_UPDATE_NEW_ITEMS_COUNT_STRING, result[1]).commit();
|
||||||
|
|
||||||
//OwnCloudReaderMethods.GetUpdatedItems(TAGS.ALL, context, lastModified, api);
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
Loading…
Reference in a new issue