I know that we can send SMS via built-in SMS app in this way -
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setData(Uri.parse("sms:"));
sendIntent.putExtra("sms_body", "");
startActivity(sendIntent);
But in my app, I want to modify some text of the sms body before sending it to the receiver. Is there any way?
I know I can do it with sendTextMessage method of SmsManager. I just want to know, is it also possible with the built-in SMS app?
Thank you.
This is not possible, since SmsManager is part of frameworks. You cannot hijack it.
Edit: What you could do is change your app manifest to recieve
ACTION_VIEW
and urisms:
just like default messaging app and then when launched will change the body and launch the default messaging app.Edit: Add below intent filter to your app and then "sms_body" extra from the intent and rebroadcast it this time by createChooser