X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;ds=sidebyside;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fasync%2FRetrieveTransactionsTask.java;h=8a9a8f62e8e98c4917aab9e383828c48f496771d;hb=6c58c1072c9af6ea0d0f52baeae7f95ba7f7ee2f;hp=93132545d87dde15bb0dbdd1e5250b75212af25a;hpb=0699ca1aaa0980079482d7479fabc4b159c9cc6f;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 93132545..8a9a8f62 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -28,7 +28,7 @@ import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.TransactionListActivity; import net.ktnx.mobileledger.model.LedgerTransaction; import net.ktnx.mobileledger.model.LedgerTransactionItem; -import net.ktnx.mobileledger.utils.MobileLedgerDatabase; +import net.ktnx.mobileledger.utils.MLDB; import net.ktnx.mobileledger.utils.NetworkUtil; import java.io.BufferedReader; @@ -94,8 +94,7 @@ public class RetrieveTransactionsTask extends publishProgress(progress); Context ctx = contextRef.get(); if (ctx == null) return null; - try (MobileLedgerDatabase dbh = new MobileLedgerDatabase(ctx)) { - try (SQLiteDatabase db = dbh.getWritableDatabase()) { + try (SQLiteDatabase db = MLDB.getWritableDatabase(ctx)) { try (InputStream resp = http.getInputStream()) { if (http.getResponseCode() != 200) throw new IOException( String.format("HTTP error %d", http.getResponseCode())); @@ -117,7 +116,7 @@ public class RetrieveTransactionsTask extends if (isCancelled()) break; if (!line.isEmpty() && (line.charAt(0) == ' ')) continue; Matcher m; - L(String.format("State is %d", state)); + //L(String.format("State is %d", state)); switch (state) { case ParserState.EXPECTING_JOURNAL: if (line.equals("

General Journal

")) {