From: Damyan Ivanov Date: Thu, 6 Dec 2018 20:37:00 +0000 (+0000) Subject: asyncTask: keep reference to the resource manager instead the activity X-Git-Tag: v0.3~323 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=55a88b63074a00d795e1e2594f0958bdd5d26b46;p=mobile-ledger.git asyncTask: keep reference to the resource manager instead the activity not that it helps decoupling much --- diff --git a/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java b/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java index 43f58e55..fc55239d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java +++ b/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java @@ -111,7 +111,7 @@ public class LatestTransactions extends AppCompatActivity { private void update_accounts() { prepare_db(); - Activity activity = this; + Resources rm = getResources(); ProgressBar pb = findViewById(R.id.progressBar); TextView pt = findViewById(R.id.textProgress); @@ -131,7 +131,7 @@ public class LatestTransactions extends AppCompatActivity { pb.setVisibility(GONE); pt.setVisibility(GONE); if (this.error != 0) - Snackbar.make(drawer, activity.getResources().getString(this.error), Snackbar.LENGTH_LONG ); + Snackbar.make(drawer, rm.getString(this.error), Snackbar.LENGTH_LONG ); } };