2

I'm using content://mms-sms/conversations to get a list of messaging threads. For some reason, it omits threads which exclusively consist of mms messages. (It does list threads which are mixed with mms and sms.) NB - I'm intentionally not using the new level 19 api. Here's my code snip:

Cursor cursor = getContentResolver().query
                (Uri.parse ("content://mms-sms/conversations"),
                 null, null, null, "date DESC");

while (cursor.moveToNext()) 
{
  long key = cursor.getLong (cursor.getColumnIndex ("_id"));
  long threadId = cursor.getLong (cursor.getColumnIndex ("thread_id"));
  String address = cursor.getString (cursor.getColumnIndex ("address")); // phone #
  long date = cursor.getLong (cursor.getColumnIndex ("date"));
  String body = cursor.getString (cursor.getColumnIndex ("body"));

  String q = String.format ("%04d %04d %10s %s %s",
                            key, threadId, address,
                            formatDate(date),
                            body == null ? "" : body.substring (0,Math.min(10,body.length()-1)));
  logD (q); // simple wrapper for Log.d()
}

cursor.close();

Has anyone else observed this? Any work around? Thanks.

Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
  • This is a good thread: http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android but from what I've read earlier API SMS/MMS access was determined by the manufacturer/device. – Stan Smith Mar 20 '14 at 00:31
  • That is a great post. I'm going to be reading it for other steps. Unfortunately it doesn't address the problem at hand. Thanks. – Peri Hartman Mar 20 '14 at 02:39
  • form [this answer](https://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android#6446831) in the thread pointed by Stan Smith: **Note: usually, when you call query and want to return all columns you can pass null as the projection parameter. However, you cannot do that with this provider, so that's why I'm using '*' **, but you are passing 'null' as second argument of the query method call. Maybe this is why you don't get 'pure mms' conversations..? – Pascal Jun 26 '18 at 07:45

0 Answers0