set the first stored profile as the current one
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 20 Jan 2019 17:45:25 +0000 (17:45 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 20 Jan 2019 17:45:25 +0000 (17:45 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java

index 004763a..7ef511d 100644 (file)
@@ -145,6 +145,9 @@ public class ProfileDetailFragment extends Fragment {
                 mProfile.storeInDB();
                 Data.profiles.add(mProfile);
                 MobileLedgerProfile.storeProfilesOrder();
+
+                // first profile ever?
+                if (Data.profiles.getList().size() == 1) Data.profile.set(mProfile);
             }
 
             Activity activity = getActivity();