X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fnew_transaction%2FNewTransactionActivity.java;h=11d014d369bd983144220d76a6267846a92e6d9e;hp=469e773e95470a55570a210dcfc423404b9fd3b9;hb=fac0809065787fb473646db5770f4f2fae0d1e8f;hpb=25cd3a8bb9b8196cddd1f66b7757cadc8248a37f diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java index 469e773e..11d014d3 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionActivity.java @@ -72,6 +72,7 @@ public class NewTransactionActivity extends ProfileThemedActivity implements TaskCallback, NewTransactionFragment.OnNewTransactionFragmentInteractionListener, QR.QRScanTrigger, QR.QRScanResultReceiver, DescriptionSelectedCallback, FabManager.FabHandler { + final String TAG = "new-t-a"; private NavController navController; private NewTransactionModel model; private ActivityResultLauncher qrScanLauncher; @@ -115,16 +116,23 @@ public class NewTransactionActivity extends ProfileThemedActivity } @Override protected void initProfile() { - long profileId = getIntent().getLongExtra("profile_id", 0); + long profileId = getIntent().getLongExtra(PARAM_PROFILE_ID, 0); + int profileHue = getIntent().getIntExtra(PARAM_THEME, -1); - if (profileId != 0) { - mProfile = Data.getProfile(profileId); - if (mProfile == null) - finish(); - Data.setCurrentProfile(mProfile); + if (profileHue < 0) { + Logger.debug(TAG, "Started with invalid/missing theme; quitting"); + finish(); + return; } - else - super.initProfile(); + + if (profileId <= 0) { + Logger.debug(TAG, "Started with invalid/missing profile_id; quitting"); + finish(); + return; + } + + setupProfileColors(profileHue); + initProfile(profileId); } @Override public void finish() {