I'm creating an Android app able to restore SMS from webservice.
I insert SMS in existing conversations and it works fine. But, if the conversation does not exists, the sms are restored but they don't appears in the sms app...
I think I have to create a new thread (a new conversation).
ContentValues initialValues;
initialValues = new ContentValues();
initialValues.put("_id", talk.getId());
initialValues.put("recipient_ids", talk.getContact().getId());
context.getContentResolver().insert(Uri.parse("content://mms-sms/conversations?simple=true"), initialValues);
App crashes with error :
MmsSmsProvider does not support deletes, inserts, or updates for this URI.content://mms-sms/conversations?simple=true
This example give you a threadId, it will create a new id if the recipient doesn't exist otherwise it will return the existing threadId: