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:
parent
be97e110a6
commit
08f3137c5b
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue