From cc31a5fd3121cdfaa78414af50028f998514d768 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 18 Sep 2018 18:15:14 +0000 Subject: [PATCH] Prevent loop --- app/src/main/java/eu/faircode/email/FragmentSetup.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index e56351dfaf..21d095e6f4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -210,10 +210,12 @@ public class FragmentSetup extends FragmentEx { prefs.edit().putString("theme", checked ? "dark" : "light").apply(); } } else { - tbDarkTheme.setChecked(false); - FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); - fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro"); - fragmentTransaction.commit(); + if (checked) { + tbDarkTheme.setChecked(false); + FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro"); + fragmentTransaction.commit(); + } } } });