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:
@@ -68,8 +68,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
logD("Activity created")
|
logD("Activity created")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onResume() {
|
||||||
super.onStart()
|
super.onResume()
|
||||||
|
|
||||||
startService(Intent(this, IndexerService::class.java))
|
startService(Intent(this, IndexerService::class.java))
|
||||||
startService(Intent(this, PlaybackService::class.java))
|
startService(Intent(this, PlaybackService::class.java))
|
||||||
|
|||||||
Reference in New Issue
Block a user