Is there a way to open up the Messaging Activity on android with a specific SMS?
threadId
should be the id of the SMS/MMS thread you want to view
Intent defineIntent = new Intent(Intent.ACTION_VIEW);
defineIntent.setData(Uri.parse("content://mms-sms/conversations/"+threadId));
myActivity.startActivity(defineIntent);
This is the simplest way I found
Try this
int req_thread_id;
Uri mSmsinboxQueryUri = Uri.parse("content://sms"));
Cursor cursor1 = getContentResolver().query(
mSmsinboxQueryUri,
new String[] { "_id", "thread_id", "address", "person", "date",
"body", "type" }, null, null, null);
startManagingCursor(cursor1);
if (cursor1.getCount() > 0)
{
while (cursor1.moveToNext())
{
int thread_id = cursor1.getInt(1);
String address; = cursor1.getString(cursor1
.getColumnIndex(columns[0]));
if("your desired no".equals(address)
req_thread_id = thread_id;
}
}
Intent defineIntent = new Intent(Intent.ACTION_VIEW);
defineIntent.setData(Uri.parse("content://mms-sms/conversations/"+req_thread_id));
myActivity.startActivity(defineIntent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With