Skip to content

Commit

Permalink
Move checking for new version to MainAcitvity
Browse files Browse the repository at this point in the history
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
  • Loading branch information
TobiGr committed Oct 12, 2021
1 parent e0ba9b3 commit 54d3bff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions app/src/main/java/org/schabi/newpipe/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
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 <[email protected]>
* App.java is part of NewPipe.
Expand Down Expand Up @@ -113,9 +111,6 @@ public void onCreate() {
&& prefs.getBoolean(getString(R.string.show_image_indicators_key), false));

configureRxJavaErrorHandler();

// Check for new version
startNewVersionCheckService();
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/org/schabi/newpipe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -163,6 +165,9 @@ protected void onCreate(final Bundle savedInstanceState) {
FocusOverlayView.setupFocusObserver(this);
}
openMiniPlayerUponPlayerStarted();

// Check for new version
startNewVersionCheckService();
}

private void setupDrawer() throws Exception {
Expand Down

0 comments on commit 54d3bff

Please sign in to comment.