Android O Background Service Limitations

Viewed 2896

In the migration guide it is suggested that we use NotificationManager.startServiceInForeground() instead of startService() when necessary.

But I cannot see any startServiceInForeground() method in NotificationManager. What am I missing?

3 Answers

They haven't changed in the migration guide yet.

You should use ContextCompat.startForegroundService() instead of NotificationManager.startServiceInForeground() method.

Related