title: Is it possible to use LiveData within AppWidgetProvider
body: <p>In my old app, this is the way how I perform time-consuming I/O operations in <code>AppWidgetProvider</code>'s <code>onUpdate</code> function.</p>
  
  <pre><code>public class MyAppWidgetProvider extends AppWidgetProvider {
      private static ExecutorService thread_executor = java.util.concurrent.Executors.newFixedThreadPool(1);
  
      @Override
      public void onUpdate(
          Runnable runnable = ...
          thread_executor.execute(runnable);
  </code></pre>
  
  <p>I don't think that is a good way, especially comes to Android 8.</p>
  
  <p>I like <code>LiveData</code> concept, as we need not handling threading explicitly. Yet, it enables us to perform time-consuming operation, without blocking Main thread.</p>
  
  <p>I was wondering, is it possible to use <code>LiveData</code>, and attach an <code>Observer</code> to perform time-consuming I/O operation (Like reading from SQLite database), within <code>AppWidgetProvider</code>? </p>
  
  <p>I'm not really sure how to do that, as I have no idea how I can get an <code>LifecycleOwner</code> in <code>AppWidgetProvider</code>, to observe <code>LiveData</code>.</p>