Browse Source

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 năm trước cách đây
mục cha
commit
12b75dce7b
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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();
     }
 }