title: Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent
body: <p>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 background. </p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalStateException: Not allowed to start
    service Intent {
    cmp=my.app.tt/com.my.service
    }: app is in background uid UidRecord{90372b1 u0a136 CEM  idle procs:1
    seq(0,0,0)}</p>
  </blockquote>
  
  <p>as I understand it related to:
  <a href="https://developer.android.com/about/versions/oreo/android-8.0-changes.html#back-all" rel="noreferrer">Background execution limits</a></p>
  
  <blockquote>
    <p>The startService() method now throws an IllegalStateException if an
    app targeting Android 8.0 tries to use that method in a situation when
    it isn't permitted to create background services.</p>
  </blockquote>
  
  <p>"<strong>in a situation when it isn't permitted</strong>" - what it's actually mean?? And how to fix it. I don't want to set my service as "foreground"</p>