Skip to content

Commit

Permalink
app: start service on draw-time
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
OxygenCobalt committed Nov 12, 2023
1 parent be97e11 commit 08f3137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/oxycblt/auxio/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 08f3137

Please sign in to comment.