Select first n rows in contentProvider

I've this select:

 final Cursor cursorConversations = getContentResolver().query(
        Uri.parse("content://gmail-ls/conversations/" + Uri.encode(mailAddress)),
        null, null, null, BaseColumns._ID + " DESC");

 ContentQueryMap mQueryMap 
        = new ContentQueryMap(cursorConversations, BaseColumns._ID, true, null);

With ContentQueyMap I can cache Cursor data and iterate in it also with the Cursor closed (i need it to boost performance).

Now, I want that the select of the Corsor only retrieve the first fifty rows. The solution of looping for 50 times in mQueryMap.getRows().entrySet() is not right: I don't want that mQueryMap gets all the rows of the Cursor, but only the first fifty.

Any idea? Does exist a where clause to get only first n rows?

7
задан MByD 8 April 2011 в 10:19
поделиться