What am doing:
Am getting recipients
list like this
Cursor c=getContentResolver().query(Uri.parse("content://sms/"), new String[]{"DISTINCT address"}, null, null, "date DESC");
while(c.moveToNext()){
String address = c.getString(0));
// Use
}
c.close();
Problem:
The sorting is not working, i get results on default order. I know this problem can be solved if i add date
column. But am using DISTINCT
which will not work properly if i'll use an extra column.
Expectation:
Is it possible to get the last sms body
, and date
of each recipient
?
Note:
- Only one
message
of each, i don't wanna load all, else the loading will take longer. - I can't query for each
recipient
one by one getting their lastmessage
ordate