- private ArrayList<LedgerTransaction> transactions;
-
- public void reloadTransactions(Context context) {
- ArrayList<LedgerTransaction> newList = new ArrayList<>();
-
- String sql = "SELECT id FROM transactions ORDER BY date desc, id desc";
-
- try (SQLiteDatabase db = MLDB.getReadableDatabase(context)) {
- try (Cursor cursor = db.rawQuery(sql, null)) {
- while (cursor.moveToNext()) {
- newList.add(new LedgerTransaction(cursor.getInt(0)));
- }
- transactions = newList;
- Log.d("transactions", "transaction list updated");
- }
- }