From 55555f564f5f60dfd6fe702ff61e9621ff3d62a0 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 18 Apr 2021 13:56:54 +0300 Subject: [PATCH] fix passing profile ID to ProfileDetailActivity --- .../ui/profiles/ProfileDetailActivity.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java index 1b88f480..42c84905 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailActivity.java @@ -36,9 +36,12 @@ import net.ktnx.mobileledger.db.Profile; import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.ui.activity.CrashReportingActivity; import net.ktnx.mobileledger.utils.Colors; +import net.ktnx.mobileledger.utils.Logger; import org.jetbrains.annotations.NotNull; +import java.util.Locale; + import static net.ktnx.mobileledger.utils.Logger.debug; /** @@ -48,13 +51,19 @@ import static net.ktnx.mobileledger.utils.Logger.debug; * in a ProfileListActivity (not really). */ public class ProfileDetailActivity extends CrashReportingActivity { + private static final String TAG = "profile-det-act"; private ProfileDetailFragment mFragment; public static void start(Context context, @Nullable Profile profile) { Intent starter = new Intent(context, ProfileDetailActivity.class); if (profile != null) { starter.putExtra(ProfileDetailFragment.ARG_ITEM_ID, profile.getId()); - starter.putExtra(ProfileDetailFragment.ARG_ITEM_ID, profile.getTheme()); + starter.putExtra(ProfileDetailFragment.ARG_HUE, profile.getTheme()); + Logger.debug(TAG, + String.format(Locale.ROOT, "Starting profile editor for profile %d, theme %d", + profile.getId(), profile.getTheme())); } + else + Logger.debug(TAG, "Starting empty profile editor"); context.startActivity(starter); } @NotNull -- 2.39.5