@Override
  public T loadInBackground() {
    Cursor cursor = null;
    try {
      CancellationSignal cancellationSignal = initCancellationSignal();
      cursor = loadCursorInBackground();
      cancellationSignal.throwIfCanceled();
      final T result = mCursorTransformation.apply(cursor, cancellationSignal);
      Preconditions.checkNotNull(result, "Function passed to this loader should never return null.");

      synchronized (pendingLoadResults) {
        pendingLoadResults.add(new Pair<>(result, cursor));
      }

      return result;
    } catch (OperationCanceledException ex) {
      releaseCursor(cursor);
      throw ex;
    } catch (Throwable t) {
      throw new RuntimeException("Error occurred when running loader: " + this, t);
    } finally {
      destroyCancellationSignal();
    }
  }
@ Override public T loadInBackground ( ) { Cursor cursor = null ; try { CancellationSignal cancellationSignal = initCancellationSignal ( ) ; cursor = loadCursorInBackground ( ) ; cancellationSignal . throwIfCanceled ( ) ; final T result = mCursorTransformation . apply ( cursor , cancellationSignal ) ; Preconditions . checkNotNull ( result , "Function passed to this loader should never return null." ) ; synchronized ( pendingLoadResults ) { pendingLoadResults . add ( new Pair < > ( result , cursor ) ) ; } return result ; } catch ( OperationCanceledException ex ) { releaseCursor ( cursor ) ; throw ex ; } catch ( Throwable t ) { throw new RuntimeException ( "Error occurred when running loader: " + this , t ) ; } finally { destroyCancellationSignal ( ) ; } }
/* Runs on a worker thread