Sorry my WRONG English first! I'm new to Java / Android, started with 4.2.1 and struggled with this after almost 2 days, then started reading more details about SQLiteQueryBuilder the query part is what you are looking for;)
he has:
public Cursor query (SQLiteDatabase db, String[] projectionIn, String selection, String[] selectionArgs, String groupBy, String having, String sortOrder)
the content provider request function of the content provider gives you:
query(Uri uri, String[] projection, String selection,String[] selectionArgs, String sortOrder)
here you can cheat, I will send you my code:
@Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); final SQLiteDatabase db = mOpenHelper.getReadableDatabase(); String groupBy = null; String having = null; switch (sUriMatcher.match(uri)) { ... ... ... case EPISODES_NEXT: groupBy = "ShowID"; queryBuilder.setTables(EpisodenTable.TableName); break; default: throw new IllegalArgumentException("Unknown URI " + uri); } Cursor c = queryBuilder.query(db, projection, selection, selectionArgs, groupBy, having, sortOrder); c.setNotificationUri(getContext().getContentResolver(), uri); return c; }
here it is!
here is the code i use to execute:
Cursor showsc = getContext().getContentResolver().query( WhatsOnTVProvider.CONTENT_EPISODES_NEXT_URI, EpisodenTable.allColums_inclCount, String.valueOf(Calendar.getInstance().getTimeInMillis() / 1000) + " < date", null, null);