public class UpdateTransactionsTask extends AsyncTask<String, Void, String> {
protected String doInBackground(String[] filterAccName) {
- final MobileLedgerProfile profile = Data.profile.getValue();
- if (profile == null)
- return "Profile not configured";
+ final MobileLedgerProfile profile = Data.getProfile();
String profile_uuid = profile.getUuid();
Data.backgroundTaskStarted();
}
debug("UTT", sql);
+ SimpleDate latestDate = null, earliestDate = null;
SQLiteDatabase db = App.getDatabase();
boolean odd = true;
SimpleDate lastDate = SimpleDate.today();
SimpleDate date =
new SimpleDate(cursor.getInt(1), cursor.getInt(2), cursor.getInt(3));
+ if (null == latestDate)
+ latestDate = date;
+ earliestDate = date;
+
if (!date.equals(lastDate)) {
boolean showMonth =
(date.month != lastDate.month) || (date.year != lastDate.year);
odd = !odd;
}
Data.transactions.setList(newList);
+ Data.latestTransactionDate.postValue(latestDate);
+ Data.earliestTransactionDate.postValue(earliestDate);
debug("UTT", "transaction list value updated");
}