2

I use this syntax for starting service on Android Oreo but Google play keep reporting that syntax affects ANR (Appklication Not Responding) on Oreo.

Report from Google Play Console.

ContextCompat.startForegroundService(context, new Intent(context, SocketService.class));

Help me solve this problem, thanks.

what is the correct way to start the service on oreo?

bcr
  • 950
  • 8
  • 28
destanti
  • 41
  • 4
  • call `startForeground (int id, Notification notification)` in onStartCommand. refer this link https://stackoverflow.com/a/6397982/7094064 – Akshay Kumar S Oct 15 '18 at 16:58

0 Answers0