On application launch, app starts the service that should to do some network task. After targeting API level 26, my application fails to start service on Android 8.0 on back
If you are running your code on 8.0 then application will crash. So start the service in the foreground. If below 8.0 use this :
Intent serviceIntent = new Intent(context, RingtonePlayingService.class);
context.startService(serviceIntent);
If above or 8.0 then use this :
Intent serviceIntent = new Intent(context, RingtonePlayingService.class);
ContextCompat.startForegroundService(context, serviceIntent );