From d322cc1e8e2bc81054cc69963dabf2d5253d3530 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 14 Jun 2020 18:59:42 +0200 Subject: [PATCH] Fixed crash when changing theme Apparently, recreate() brings RxJava in a strange state where errors are directly thrown instead of relaying them to the error callback. Because of a race condition in ItemDescriptionFragment.loadData, this throws a NPE. --- .../java/de/danoeh/antennapod/activity/MainActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index e05538b63..eaa423708 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -317,9 +317,8 @@ public class MainActivity extends CastEnabledActivity { RatingDialog.init(this); if (lastTheme != UserPreferences.getNoTitleTheme()) { - // Nav drawer is empty for half a second after recreating. Don't confuse users with that. - drawerLayout.closeDrawer(navDrawer); - recreate(); + finish(); + startActivity(new Intent(this, MainActivity.class)); } }