]> git.ktnx.net Git - mobile-ledger.git/commitdiff
call setupProfile in onCreate, not in onResume
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 11 Mar 2019 18:32:07 +0000 (20:32 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 14 Mar 2019 20:54:57 +0000 (22:54 +0200)
onResume is also called when the app is brought to the front and there is no
need to refresh profile data at this time

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index ecd78167354df9b5bc046381476e27ba16186535..64a30812437677d3a8ea349e9f1cb1004c12e2b5 100644 (file)
@@ -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();