@@ -166,6 +166,15 @@ protected void onCreate(final Bundle savedInstanceState) {
166166 openMiniPlayerUponPlayerStarted ();
167167 }
168168
169+ @ Override
170+ protected void onPostCreate (final Bundle savedInstanceState ) {
171+ super .onPostCreate (savedInstanceState );
172+ // Start the service which is checking all conditions
173+ // and eventually searching for a new version.
174+ // The service searching for a new NewPipe version must not be started in background.
175+ startNewVersionCheckService ();
176+ }
177+
169178 private void setupDrawer () throws Exception {
170179 //Tabs
171180 final int currentServiceId = ServiceHelper .getSelectedServiceId (this );
@@ -516,19 +525,6 @@ protected void onResume() {
516525 getString (R .string .enable_watch_history_key ), true );
517526 drawerLayoutBinding .navigation .getMenu ().findItem (ITEM_ID_HISTORY )
518527 .setVisible (isHistoryEnabled );
519-
520- if (!App .wasAppInForeground ()) {
521- // Check for new app version
522- // The service searching for a new NewPipe version must not be started in background
523- // and therefore needs to be placed in onResume().
524- // Only start the service once when app is started
525- // and not everytime onResume() is called.
526- if (DEBUG ) {
527- Log .d (TAG , "App is in foreground for the first time" );
528- }
529- App .setWasAppInForeground (true );
530- startNewVersionCheckService ();
531- }
532528 }
533529
534530 @ Override
0 commit comments