From 4a80939836e8e3c3a63ca1d5e905f8f1e03fb122 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 7 Dec 2018 05:56:44 +0000 Subject: [PATCH] use the global reference instead of passing it to execute() --- .../main/java/net/ktnx/mobileledger/AccountSummary.java | 3 +-- .../java/net/ktnx/mobileledger/RetrieveAccountsTask.java | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java index 882403ec..ec122cd4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java +++ b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java @@ -22,7 +22,6 @@ import android.widget.TextView; import java.util.Date; import static android.view.View.GONE; -import static net.ktnx.mobileledger.MobileLedgerDB.db; import static net.ktnx.mobileledger.MobileLedgerDB.set_option_value; public class AccountSummary extends AppCompatActivity { @@ -171,7 +170,7 @@ public class AccountSummary extends AppCompatActivity { }; task.setPref(PreferenceManager.getDefaultSharedPreferences(this)); - task.execute(db); + task.execute(); } } diff --git a/app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java b/app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java index 670b1493..0956f638 100644 --- a/app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java @@ -1,7 +1,6 @@ package net.ktnx.mobileledger; import android.content.SharedPreferences; -import android.database.sqlite.SQLiteDatabase; import android.util.Log; import java.io.BufferedReader; @@ -14,7 +13,9 @@ import java.net.URLDecoder; import java.util.regex.Matcher; import java.util.regex.Pattern; -abstract public class RetrieveAccountsTask extends android.os.AsyncTask { +import static net.ktnx.mobileledger.MobileLedgerDB.db; + +abstract public class RetrieveAccountsTask extends android.os.AsyncTask { int error; private SharedPreferences pref; @@ -25,8 +26,7 @@ abstract public class RetrieveAccountsTask extends android.os.AsyncTask