From 831ffd898c61c728d860f908e1dec288ae4060a3 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 11 Mar 2019 20:32:07 +0200 Subject: [PATCH] call setupProfile in onCreate, not in onResume onResume is also called when the app is brought to the front and there is no need to refresh profile data at this time --- .../net/ktnx/mobileledger/ui/activity/MainActivity.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index ecd78167..64a30812 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -115,6 +115,8 @@ public class MainActivity extends ProfileThemedActivity { setContentView(R.layout.activity_main); + setupProfile(); + fab = findViewById(R.id.btn_add_transaction); profileListContainer = findViewById(R.id.nav_profile_list_container); profileListHeadArrow = findViewById(R.id.nav_profiles_arrow); @@ -291,11 +293,6 @@ public class MainActivity extends ProfileThemedActivity { intent.putExtra(BUNDLE_SAVED_STATE, bundle); startActivity(intent); } - @Override - protected void onResume() { - super.onResume(); - setupProfile(); - } public void startEditProfileActivity(MobileLedgerProfile profile) { Intent intent = new Intent(this, ProfileDetailActivity.class); Bundle args = new Bundle(); -- 2.39.5