Skip to content

Commit 54d3bff

Browse files
committed
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
1 parent e0ba9b3 commit 54d3bff

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/App.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
import io.reactivex.rxjava3.functions.Consumer;
4444
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
4545

46-
import static org.schabi.newpipe.CheckForNewAppVersion.startNewVersionCheckService;
47-
4846
/*
4947
* Copyright (C) Hans-Christoph Steiner 2016 <hans@eds.org>
5048
* App.java is part of NewPipe.
@@ -113,9 +111,6 @@ public void onCreate() {
113111
&& prefs.getBoolean(getString(R.string.show_image_indicators_key), false));
114112

115113
configureRxJavaErrorHandler();
116-
117-
// Check for new version
118-
startNewVersionCheckService();
119114
}
120115

121116
@Override

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
package org.schabi.newpipe;
2222

23+
import static org.schabi.newpipe.CheckForNewAppVersion.startNewVersionCheckService;
24+
2325
import android.content.BroadcastReceiver;
2426
import android.content.Context;
2527
import android.content.Intent;
@@ -163,6 +165,9 @@ protected void onCreate(final Bundle savedInstanceState) {
163165
FocusOverlayView.setupFocusObserver(this);
164166
}
165167
openMiniPlayerUponPlayerStarted();
168+
169+
// Check for new version
170+
startNewVersionCheckService();
166171
}
167172

168173
private void setupDrawer() throws Exception {

0 commit comments

Comments
 (0)