1

StartService is throwing exception when triggered on Oreo while in previous android was playing fine. So on MainActivity I have

play.Click += (sender, args) => SendAudioCommand(StreamingBackgroundService.ActionPlay);
  private void SendAudioCommand(string action)
    {
        var intent = new Intent(action);
        StartService(intent);
    }

And when I press play button it throws exception on StartService Command while the intent var is not null. I 've read a lot about JobScheduler but nothing telling about background service as sticky running it from main activity with other way of StartService.

The exception is : Unhandled Exception: Java.Lang.IllegalStateException: occurred

newbie
  • 43
  • 1
  • 10
  • `exception` :Add the exception/stacktrace to your question – SushiHangover Sep 08 '18 at 14:00
  • Unhandled Exception: Java.Lang.IllegalStateException: occurred – newbie Sep 08 '18 at 14:05
  • 1
    this error is related with new limitations added on Andorid O. a `Service` cannot be called in the background and a new way of calling it was introduced but it also requires other changes to be done in the service itself. This thread explain the options you have: https://stackoverflow.com/a/50207754/1771254 – pinedax Sep 08 '18 at 16:37

0 Answers0