mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fix crash on pre-4.1 devices.
This commit is contained in:
parent
de773435d8
commit
cbf90e7dac
1 changed files with 6 additions and 3 deletions
|
@ -4,6 +4,7 @@ import android.content.AsyncTaskLoader;
|
|||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.os.CancellationSignal;
|
||||
import android.os.Build;
|
||||
import android.os.OperationCanceledException;
|
||||
|
||||
/**
|
||||
|
@ -25,10 +26,12 @@ public abstract class QueryCursorLoader extends AsyncTaskLoader<Cursor> {
|
|||
@Override
|
||||
public Cursor loadInBackground() {
|
||||
synchronized (this) {
|
||||
if (isLoadInBackgroundCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
if (isLoadInBackgroundCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
cancellationSignal = new CancellationSignal();
|
||||
}
|
||||
cancellationSignal = new CancellationSignal();
|
||||
}
|
||||
try {
|
||||
Cursor c = createCursor();
|
||||
|
|
Loading…
Add table
Reference in a new issue