app: start service on draw-time

Recently, Android 14 seemed to have finally made it impossible to start
services in onStart. I never realized this error since I thought
onStart signified the beginning of the foreground state, when it was
actually onResume. I think it only worked prior due to race conditions.
Try to fix it by moving the service starting code to onResume.

See #608.
This commit is contained in:
Alexander Capehart 2023-11-11 22:43:17 -07:00
parent be97e110a6
commit 08f3137c5b
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -68,8 +68,8 @@ class MainActivity : AppCompatActivity() {
logD("Activity created")
}
override fun onStart() {
super.onStart()
override fun onResume() {
super.onResume()
startService(Intent(this, IndexerService::class.java))
startService(Intent(this, PlaybackService::class.java))