From 75e0c6a16647779d52f6dbed0454158ca3220b15 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 14 Jun 2023 09:18:14 +0200 Subject: [PATCH] Fix crash when repeatedly starting offline background player --- .../com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt index de255f5a4..78bcc1cba 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/DownloadOptionsBottomSheet.kt @@ -35,6 +35,7 @@ class DownloadOptionsBottomSheet( 0 -> { val playerIntent = Intent(requireContext(), OfflinePlayerService::class.java) .putExtra(IntentData.videoId, download.videoId) + context?.stopService(playerIntent) ContextCompat.startForegroundService(requireContext(), playerIntent) } 1 -> {