Massive/android/app/src/main/java/com/massive/StopTimer.kt
Brandon Presley e4ed53c358 Move logic of TimerService into TimerBroadcast
This was supposed to solve the timer stopping sometimes
when the application was in the background.
It was actually stopping because of battery optimizations.
2022-07-06 16:27:36 +12:00

17 lines
477 B
Kotlin

package com.massive
import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.util.Log
class StopTimer : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
applicationContext.stopService(Intent(applicationContext, TimerService::class.java))
return super.onStartCommand(intent, flags, startId)
}
override fun onBind(p0: Intent?): IBinder? {
return null
}
}