From 54d3bff26df81b828be14448cff40e3751ad369a Mon Sep 17 00:00:00 2001 From: TobiGr Date: Tue, 12 Oct 2021 16:44:17 +0200 Subject: [PATCH] Move checking for new version to MainAcitvity When the service is started from the Application class, the app might be still in the background. This is definetly not the case when MainActivity.onCreate() is called. Fixes #7227 --- app/src/main/java/org/schabi/newpipe/App.java | 5 ----- app/src/main/java/org/schabi/newpipe/MainActivity.java | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index 35b0b2674..b44f7517d 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -43,8 +43,6 @@ import io.reactivex.rxjava3.exceptions.UndeliverableException; import io.reactivex.rxjava3.functions.Consumer; import io.reactivex.rxjava3.plugins.RxJavaPlugins; -import static org.schabi.newpipe.CheckForNewAppVersion.startNewVersionCheckService; - /* * Copyright (C) Hans-Christoph Steiner 2016 * App.java is part of NewPipe. @@ -113,9 +111,6 @@ public class App extends MultiDexApplication { && prefs.getBoolean(getString(R.string.show_image_indicators_key), false)); configureRxJavaErrorHandler(); - - // Check for new version - startNewVersionCheckService(); } @Override diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 5b1cf48e5..18ab69b7b 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -20,6 +20,8 @@ package org.schabi.newpipe; +import static org.schabi.newpipe.CheckForNewAppVersion.startNewVersionCheckService; + import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -163,6 +165,9 @@ public class MainActivity extends AppCompatActivity { FocusOverlayView.setupFocusObserver(this); } openMiniPlayerUponPlayerStarted(); + + // Check for new version + startNewVersionCheckService(); } private void setupDrawer() throws Exception {