From 3d6624b7751fa97edf71b7b1398867357aedb90d Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 24 Mar 2019 11:41:27 +0200 Subject: [PATCH] beginTransaction should be outside the try{} block --- .../net/ktnx/mobileledger/async/RetrieveTransactionsTask.java | 1 - .../java/net/ktnx/mobileledger/model/MobileLedgerProfile.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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}); -- 2.39.5