@Override
 protected void onStartLoading() {
   if (DEBUG) {
     Log.i(LOG_TAG, "onStartLoading()");
   }
   // If we already have a result, deliver it immediately.
   if (!mPrintJobs.isEmpty()) {
     deliverResult(new ArrayList<PrintJobInfo>(mPrintJobs));
   }
   // Start watching for changes.
   if (mPrintJobStateChangeListener == null) {
     mPrintJobStateChangeListener =
         new PrintJobStateChangeListener() {
           @Override
           public void onPrintJobStateChanged(PrintJobId printJobId) {
             onForceLoad();
           }
         };
     mPrintManager.addPrintJobStateChangeListener(mPrintJobStateChangeListener);
   }
   // If the data changed or we have no data - load it now.
   if (mPrintJobs.isEmpty()) {
     onForceLoad();
   }
 }
 @Override
 public void setListening(boolean isListening) {
   if (mPrintManager != null) {
     if (isListening) {
       mPrintManager.addPrintJobStateChangeListener(this);
       onPrintJobStateChanged(null);
     } else {
       mPrintManager.removePrintJobStateChangeListener(this);
     }
   }
 }