user1301428
user1301428

Reputation: 1783

Sort SMS messages in ascending order

When I query the SMS provider in Android I get the messages in from the older ones to the most recent ones. I am using the following query:

Cursor cursor = getContentResolver().query(messagesUri,null,null,null,null);

Is it possible to sort it the opposite way?

Upvotes: 3

Views: 3549

Answers (1)

user1301428
user1301428

Reputation: 1783

The solution is to transform the last argument from null to date ASC:

Cursor cursor = getContentResolver().query(messagesUri,null,null,null,"date ASC");

Upvotes: 7

Related Questions