From 55a88b63074a00d795e1e2594f0958bdd5d26b46 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 6 Dec 2018 20:37:00 +0000 Subject: [PATCH] asyncTask: keep reference to the resource manager instead the activity not that it helps decoupling much --- .../main/java/net/ktnx/mobileledger/LatestTransactions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); } }; -- 2.39.5