From 7c3f5a62c5c5c841e3d86c8f4151cec328262ee2 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 10 Jul 2021 10:17:00 +0200 Subject: [PATCH] Fix crash when refreshing feed after importing database or subscriptions The database was not closed correctly --- app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index d6e1888e1..c35cceb66 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentTransaction; import com.nostra13.universalimageloader.core.ImageLoader; import org.schabi.newpipe.MainActivity; +import org.schabi.newpipe.NewPipeDatabase; import org.schabi.newpipe.R; import org.schabi.newpipe.RouterActivity; import org.schabi.newpipe.about.AboutActivity; @@ -608,6 +609,7 @@ public final class NavigationHelper { * @param activity the activity to finish */ public static void restartApp(final Activity activity) { + NewPipeDatabase.getInstance(activity).close(); activity.finishAffinity(); final Intent intent = new Intent(activity, MainActivity.class); activity.startActivity(intent);