From fff404ed229729d97ca978d344f712670a1d402d Mon Sep 17 00:00:00 2001 From: kik-btaski Date: Sat, 20 Jan 2024 12:54:47 +0530 Subject: [PATCH] stop recorder service on stop recording Ref: https://developer.android.com/reference/android/app/Service#service-lifecycle Related Error: Leaked service connection --- app/src/main/java/com/bnyro/recorder/services/RecorderService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/bnyro/recorder/services/RecorderService.kt b/app/src/main/java/com/bnyro/recorder/services/RecorderService.kt index 35fed41c..1c146e7d 100644 --- a/app/src/main/java/com/bnyro/recorder/services/RecorderService.kt +++ b/app/src/main/java/com/bnyro/recorder/services/RecorderService.kt @@ -213,6 +213,7 @@ abstract class RecorderService : Service() { } ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE) + stopSelf() super.onDestroy() }