I am using android.provider.Telephony.SMS_RECEIVED
to listen to incoming SMS. I was successful catch SMS body and SMS number from the sender. I want to open the SMS application with the body and the number using Android Intent(similar when you receive an SMS and open SMS app to see detail). How can I do it in Android 5.0? I am using the bellow code, but it is for sending a message. It means it opened the window that has number and body +send button. I don't want that window. I just want reading GUI
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", SMSNumber);
smsIntent.putExtra("sms_body",SMSBody);
smsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(smsIntent);
ACTION_VIEW
does not take extras. It does take aUri
. If you have read access to theSms
provider, you are welcome to try to find the message in the inbox, then tryACTION_VIEW
with theUri
to that message. However, there is no requirement that any Android device have an app with an activity that supports this.