]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java
update_accounts: put all execSQL in the try{} block
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / RetrieveAccountsTask.java
index 8f6b32d73fe8801b16b0dc54feb3ca91fb8d21c3..b3ad57784962577c78f88fc3f8ffe1838f6904cd 100644 (file)
@@ -40,10 +40,11 @@ abstract public class RetrieveAccountsTask extends android.os.AsyncTask<SQLiteDa
                 }
                 else {
                     db.beginTransaction();
-                    db.execSQL("delete from account_values;");
-                    db.execSQL("delete from accounts;");
 
                     try {
+                        db.execSQL("update account_values set keep=0;");
+                        db.execSQL("update accounts set keep=0;");
+
                         String line;
                         String last_account_name = null;
                         BufferedReader buf = new BufferedReader(new InputStreamReader(resp, "UTF-8"));