title: How to show loader while loading data from new room persistence library and have callbacks like failure or success
body: <p>I am trying to use room for my local db and my problem is that my first screen of app show the list of devices saved in room library, but room does't provide any callback like success or failure so how you guys deal with that?, also how can I show a loader while loading the data from room as I can't  work on ui from a thread until it runs on ui thread which is not recommended by room.</p>
  
  <pre><code>private void getDevices(){
      AsyncTask.execute(new Runnable() {
          @Override
          public void run() {
  
              devicesList =
              AppDatabase.getAppDatabase(getActivity()).deviceDao().getAllDevices();
              devicesAdapter.notifyDataSetChanged();
  
          }
      });
  
  
  }
  </code></pre>