최근 사용한 앱에서 태스크 종료

- service가 종료되도록 코드 추가
This commit is contained in:
klaus 2024-12-18 18:24:02 +09:00
parent 6dd9520bda
commit 187f1f9d37
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class AudioContentPlayerService : MediaSessionService() {
super.onDestroy()
}
override fun onTaskRemoved(rootIntent: Intent?) {
onStopService()
}
override fun onGetSession(controllerInfo: MediaSession.ControllerInfo) = mediaSession
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {