use of android.database.sqlite.SQLiteQueryBuilder in project cw-advandroid by commonsguy.
the class Provider method query.
@Override
public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, String sort) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(TABLE);
String orderBy;
if (TextUtils.isEmpty(sort)) {
orderBy = Constants.DEFAULT_SORT_ORDER;
} else {
orderBy = sort;
}
Cursor c = qb.query(db.getReadableDatabase(), projection, selection, selectionArgs, null, null, orderBy);
c.setNotificationUri(getContext().getContentResolver(), url);
return (c);
}
use of android.database.sqlite.SQLiteQueryBuilder in project cw-omnibus by commonsguy.
the class Provider method query.
@Override
public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, String sort) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(TABLE);
String orderBy;
if (TextUtils.isEmpty(sort)) {
orderBy = Constants.DEFAULT_SORT_ORDER;
} else {
orderBy = sort;
}
Cursor c = qb.query(db.getReadableDatabase(), projection, selection, selectionArgs, null, null, orderBy);
c.setNotificationUri(getContext().getContentResolver(), url);
return (c);
}
use of android.database.sqlite.SQLiteQueryBuilder in project ADWLauncher2 by boombuler.
the class LauncherProvider method query.
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(args.table);
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder);
result.setNotificationUri(getContext().getContentResolver(), uri);
return result;
}
use of android.database.sqlite.SQLiteQueryBuilder in project Brion-Learns-OAuth by brione.
the class BloaProvider method query.
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor c = null;
switch(sUriMatcher.match(uri)) {
case USER_STATUS_RECORDS:
qb.setTables(USER_STATUS_RECORDS_TABLE_NAME);
qb.setProjectionMap(sUserStatusProjectionMap);
c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);
break;
case USER_STATUS_RECORD_ID:
qb.setTables(USER_STATUS_RECORDS_TABLE_NAME);
qb.setProjectionMap(sUserStatusProjectionMap);
qb.appendWhere(UserStatusRecords.UserStatusRecord._ID + "=" + uri.getPathSegments().get(1));
c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);
break;
default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
// Tell the cursor what uri to watch, so it knows when its source data
// changes
c.setNotificationUri(mCR, uri);
return c;
}
use of android.database.sqlite.SQLiteQueryBuilder in project Launcher3 by chislon.
the class LauncherProvider method query.
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
SqlArguments args = new SqlArguments(uri, selection, selectionArgs);
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(args.table);
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
Cursor result = qb.query(db, projection, args.where, args.args, null, null, sortOrder);
result.setNotificationUri(getContext().getContentResolver(), uri);
return result;
}
Aggregations