SGS-3 bug related to SMS conversations list?

后端 未结 3 1833
孤街浪徒
孤街浪徒 2020-12-09 22:56

This issue was reported several times, but still not resolved yet. I read all messages/thread which somehow related to this topic either in Samsung\'s developers site or in

相关标签:
3条回答
  • 2020-12-09 23:20

    In the end I've figured how to overcome aforementioned issue (I am not sure that it's bug, but anyway it looks like a bug).

    List of conversations can be retrieved through this query:

    Uri.parse("content://mms-sms/conversations?simple=true"); 
    Cursor cursor = context.getApplicationContext().getContentResolver().query(uri, null, null, null, null);
    

    Keypoint here's URI content://mms-sms/conversations?simple=true.

    0 讨论(0)
  • 2020-12-09 23:21

    I also encountered this problem and it seems that there is no solving for it atm. Checked @barmaley answer and it also produce same exception for me

    @edit my friend just checked this on his sgs3 and it works! but he cannot get body/adress column, but its a start! It is very very weird that it works on his not on mine. Mine sgs3 is from Polish distribution and his is from usa... if there is difference between regions this can be worse than expected

    0 讨论(0)
  • 2020-12-09 23:25

    If only interested in SMS conversations, and want addition SMS columns you don't get with content://mms-sms/conversations?simple=true, then you can try doing your own grouping on the SMS in the ContentResolver query.

    • uri = content://sms
    • projection = "DISTINCT " + Inbox.THREAD_ID, Inbox.ADDRESS, Inbox.BODY, Inbox.DATE etc...
    • selection = Inbox.THREAD_ID + " IS NOT NULL) GROUP BY (" + Inbox.THREAD_ID
    • sortOrder = Inbox.DEFAULT_SORT_ORDER

    Note that I had to insert a dummy condition 'IS NOT NULL' before GROUP BY, because of the way that ContentResolver adds brackets to the database query it generates.

    0 讨论(0)
提交回复
热议问题