Methods Summary |
---|
public void | cancelLoadInBackground()
super.cancelLoadInBackground();
synchronized (this) {
if (mCancellationSignal != null) {
mCancellationSignal.cancel();
}
}
|
private void | closeQuietly(R result)
if (result instanceof AutoCloseable) {
try {
((AutoCloseable) result).close();
} catch (RuntimeException rethrown) {
throw rethrown;
} catch (Exception ignored) {
}
}
|
public void | deliverResult(R result)
if (isReset()) {
closeQuietly(result);
return;
}
R oldResult = mResult;
mResult = result;
if (isStarted()) {
super.deliverResult(result);
}
if (oldResult != null && oldResult != result) {
closeQuietly(oldResult);
}
|
public final R | loadInBackground()
synchronized (this) {
if (isLoadInBackgroundCanceled()) {
throw new OperationCanceledException();
}
mCancellationSignal = new CancellationSignal();
}
try {
return loadInBackground(mParam, mCancellationSignal);
} finally {
synchronized (this) {
mCancellationSignal = null;
}
}
|
public abstract R | loadInBackground(P param, android.os.CancellationSignal signal)
|
public void | onCanceled(R result)
closeQuietly(result);
|
protected void | onReset()
super.onReset();
// Ensure the loader is stopped
onStopLoading();
closeQuietly(mResult);
mResult = null;
getContext().getContentResolver().unregisterContentObserver(mObserver);
|
protected void | onStartLoading()
if (mResult != null) {
deliverResult(mResult);
}
if (takeContentChanged() || mResult == null) {
forceLoad();
}
|
protected void | onStopLoading()
cancelLoad();
|