'ForegroundServiceStartNotAllowedException
I have a question.
Android 8.0 introduces a new Context.startForegroundService () method that creates a new service in the foreground.
But I update target version to Android 12 , App is crushed. Error is ForegroundServiceStartNotAllowedException.
I'm implementing app like spotify or apple music.
Shouldn't startForegroundService() be used in applications with the target version set to Android 12? And Should I use only startForeground() ?
Thank you.
Solution 1:[1]
The Behavior Changes Again.
https://developer.android.com/guide/components/foreground-services
You should start the service when the app is in front.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | haoxiqiang |
