From: Damyan Ivanov Date: Sun, 24 Mar 2019 09:41:27 +0000 (+0200) Subject: beginTransaction should be outside the try{} block X-Git-Tag: v0.8.1~16 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=3d6624b7751fa97edf71b7b1398867357aedb90d;p=mobile-ledger.git beginTransaction should be outside the try{} block --- 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 69b43fa6..f9297f00 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -438,7 +438,6 @@ public class RetrieveTransactionsTask db.endTransaction(); } } - return true; } private boolean retrieveTransactionList(MobileLedgerProfile profile) diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index e466d3d9..9d87d0c8 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -283,8 +283,8 @@ public final class MobileLedgerProfile { public void removeFromDB() { SQLiteDatabase db = MLDB.getDatabase(); Log.d("db", String.format("removing profile %s from DB", uuid)); + db.beginTransaction(); try { - db.beginTransaction(); db.execSQL("delete from profiles where uuid=?", new Object[]{uuid}); db.execSQL("delete from accounts where profile=?", new Object[]{uuid}); db.execSQL("delete from account_values where profile=?", new Object[]{uuid});