-1

I am trying to find a solution for my problem. The problem is that I am trying to start a background service in Oreo in order to retrieve locations. I have seen this: https://developer.android.com/about/versions/oreo/background-location-limits but I am trying to find a solution for this.

When I startforeground service I see this: (IllegalStateException: Not allowed to start service) exception, because I am trying to retrieve locations for the next 3 minutes

1 Answers1

0

The correct answer is that we cannot start a foreground service in SDK>= Oreo, because Android tries to improve the life battery. So the system kills any service (either Background or Foreground).