There is SQL
in which, suppose, 500 lines. I'm using the query
Cursor cursor = db.query(MESSAGES_TABLE, projection, selection, selectionArgs, null, null, sortOrder, howManyShow);
where selection
, selectionArgs
- selectionArgs
conditions (for example, " channel = ?
", "67822" - display messages only with the field channel = 67822
) database and pass to the cursor only 30)
Accordingly, in the cursor we get 30 messages, starting from the 500th. But I need to fill my ListFragment
with this cursor in the reverse order, so that the "500th" message is at the bottom of the List
. Is there any option how to change the request so that the same 30 messages are displayed in the cursor
in the reverse order (the "500th" message last ").
The number of rows in the database is not static. Also, the method of sending 2 requests will not work because the cursor will then not be updated correctly.
ListFragment
filled with its own adapter inherited from SimpleCursorAdapter
. If the request cannot be changed to fit my wishes, there may be ways to change the order of filling the List
using the adapter
'a methods. Search in Google says that you need to change the request, but I don’t think how to change it correctly.