Fehler startForeground nach Update auf Android 8.1: Wie beheben?
Hallo zusammen! Ich entwickle eine App in Kotlin, die einen Hintergrund-Service zur Standortermittlung verwendet. Nach dem Update meines Geräts auf Android 8.1 (Oreo) funktioniert mein Service nicht mehr und stürzt mit dem Fehler `Context.startForegroundService() did not then call Service.startForeground()` ab. Hier ist mein Service-Code:
```kotlin
class LocationService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val notification = NotificationCompat.Builder(this, "channel_id")
.setContentTitle("Service aktiv")
.setContentText("Standortermittlung")
.setSmallIcon(R.drawable.ic_location)
.build()
startForeground(1, notification)
return START_STICKY
}
override f