فهرست منبع

Starts foreground service before stopping it to avoid app crash when listening to an audio file

Signed-off-by: Guillermo Mtz Espina <gmotzespina@icloud.com>
Guillermo Mtz Espina 3 سال پیش
والد
کامیت
12b75dce7b
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/main/java/com/nextcloud/client/media/PlayerService.kt

+ 2 - 1
src/main/java/com/nextcloud/client/media/PlayerService.kt

@@ -178,7 +178,8 @@ class PlayerService : Service() {
             player.stop(file)
         }
 
-        stopSelf()
+        startForeground(R.string.media_notif_ticker, notificationBuilder.build())
         stopForeground(true)
+        stopSelf();
     }
 }