use of androidx.loader.content.CursorLoader in project fdroidclient by f-droid.
the class ManageReposActivity method onCreateLoader.
@NonNull
@Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
Uri uri = RepoProvider.allExceptSwapUri();
final String[] projection = { RepoTable.Cols._ID, RepoTable.Cols.NAME, RepoTable.Cols.SIGNING_CERT, RepoTable.Cols.FINGERPRINT, RepoTable.Cols.IN_USE };
return new CursorLoader(this, uri, projection, null, null, null);
}
use of androidx.loader.content.CursorLoader in project fdroidclient by f-droid.
the class UtilsTest method testGetAntifeatureSQLFilter.
@Test
public void testGetAntifeatureSQLFilter() {
CursorLoader cursorLoader = new CursorLoader(context, AppProvider.getLatestTabUri(), Schema.AppMetadataTable.Cols.ALL, Utils.getAntifeatureSQLFilter(context), null, null);
cursor = cursorLoader.loadInBackground();
assertNotNull(cursor);
}
use of androidx.loader.content.CursorLoader in project collect by opendatakit.
the class CursorLoaderFactory method createCompletedUndeletedInstancesCursorLoader.
public CursorLoader createCompletedUndeletedInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
CursorLoader cursorLoader;
if (charSequence.length() == 0) {
cursorLoader = createCompletedUndeletedInstancesCursorLoader(sortOrder);
} else {
String selection = DatabaseInstanceColumns.DELETED_DATE + " IS NULL and (" + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=?) and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
String[] selectionArgs = { Instance.STATUS_COMPLETE, Instance.STATUS_SUBMISSION_FAILED, Instance.STATUS_SUBMITTED, "%" + charSequence + "%" };
cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
}
return cursorLoader;
}
use of androidx.loader.content.CursorLoader in project collect by opendatakit.
the class CursorLoaderFactory method createFinalizedInstancesCursorLoader.
public CursorLoader createFinalizedInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
CursorLoader cursorLoader;
if (charSequence.length() == 0) {
cursorLoader = createFinalizedInstancesCursorLoader(sortOrder);
} else {
String selection = "(" + DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=?) and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
String[] selectionArgs = { Instance.STATUS_COMPLETE, Instance.STATUS_SUBMISSION_FAILED, "%" + charSequence + "%" };
cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
}
return cursorLoader;
}
use of androidx.loader.content.CursorLoader in project collect by opendatakit.
the class CursorLoaderFactory method createSentInstancesCursorLoader.
public CursorLoader createSentInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
CursorLoader cursorLoader;
if (charSequence.length() == 0) {
cursorLoader = createSentInstancesCursorLoader(sortOrder);
} else {
String selection = DatabaseInstanceColumns.STATUS + " =? and " + DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
String[] selectionArgs = { Instance.STATUS_SUBMITTED, "%" + charSequence + "%" };
cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
}
return cursorLoader;
}
Aggregations