title: Android Oreo+ : AppWidget click doesn't invoke JobIntentService.onHandleWork()
body: <p>I have a widget. Finishing the SettingsActivity loads data from the Internet and displays it inside a ListView. This works on pre-Oreo and Oreo devices.</p>
  
  <p>But the following two behaviors are not triggered from any activity, but from clicks on the widget itself (= background) and work only on pre-Oreo devices :</p>
  
  <ul>
  <li><p>Clicking on the ListView itself opens the browser to navigate to the url of that item.</p></li>
  <li><p>Clicking on a button above the ListView opens the settings activity.</p></li>
  </ul>
  
  <p>But on Oreo after getting exceptions like </p>
  
  <pre><code>Not allowed to start service Intent
  </code></pre>
  
  <p>I switched from IntentService to JobIntentService because :</p>
  
  <p><a href="https://developer.android.com/about/versions/oreo/background#services" rel="nofollow noreferrer">From developer.android.com :</a></p>
  
  <blockquote>
    <p>IntentService is subject to these restrictions IntentService is a
    service, and is therefore subject to the new restrictions on
    background services. As a result, many apps that rely on IntentService
    do not work properly when targeting Android 8.0 or higher. For this
    reason, Android Support Library 26.0.0 introduces a new
    JobIntentService class, which provides the same functionality as
    IntentService but uses jobs instead of services when running on
    Android 8.0 or higher.</p>
  </blockquote>
  
  <p>Manifest :</p>
  
  <pre><code>&lt;service
              android:name="com.example.MyWidgetService"
              android:permission="android.permission.BIND_JOB_SERVICE"/&gt;
  </code></pre>
  
  <p>Service :</p>
  
  <pre><code>public class MyWidgetService extends JobIntentService {
      @Override
      protected void onHandleWork(Intent intent) {
          XLog.i("onHandleWork"); &lt;-- never printed to log
      }
  }
  </code></pre>
  
  <p>In Widget's RemoteViewsService :</p>
  
  <pre><code>remote.setOnClickPendingIntent(R.id.open, new Intent(..some-code..));
  </code></pre>
  
  <p>The modified code works on pre-Oreo devices but on Oreo clicking neither on a list-view item nor on the button does nothing, MyWidgetService.onHandleWork() is never invoked.</p>
  
  <p>Any idea what I'm doing wrong ?</p>