I am working on an android sms application.I can send sms to single contact by using the following code.

sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);

Now I want to send sms to multicontacts.Some suggest to use loop.SO now I am using loops to send sms to multicontact.

After sending each sms I write those values to sent table.

 ContentValues values = new ContentValues();
    values.put("address", mobNo);
    values.put("body", msg);
    getContentResolver().insert(Uri.parse("content://sms/sent"), values); 

Every new address will create a new thread id. For example if my receiver's address is x, then thread id 1, for y thread id 2.And if I want to send sms to both x and y ,then how can I write in to sms/sent table. If I use Loop,then it won't create any new thread id, because send address x already have thread id 1 and y already have thread id 2.So messages will listed under thread id 1 and 2 never creates a new thread id.

I tried to manualy insert thread id by

values.put("thread_id", 33);

But then the messages under new thread id do not listed in default app but in my app.

Please help me friends

Edit:I tried using 0, and then reading the thread_id that was generated, then place the next sms with this thread_id, still doesn't works.

Edit
Report