From 4c9106fe28a514bda57696bd22ae1c4c1ddd1f8a Mon Sep 17 00:00:00 2001 From: 2taezeat Date: Fri, 8 Dec 2023 02:11:28 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20onStop=EC=97=90=20pause()=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=ED=98=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/main/java/com/ohdodok/catchytape/MainActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt b/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt index 89d1968..a800c68 100644 --- a/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt +++ b/android/app/src/main/java/com/ohdodok/catchytape/MainActivity.kt @@ -80,6 +80,11 @@ class MainActivity : AppCompatActivity() { connectToMediaSession() } + override fun onStop() { + player.pause() + super.onStop() + } + private fun connectToMediaSession() { val sessionToken = SessionToken(this, ComponentName(this, PlaybackService::class.java)) MediaController.Builder(this, sessionToken).buildAsync()