How to send a text message on Android

Asked 2 years ago, Updated 2 years ago, 47 views

I'd like to send a text message. Can I know what the intent is that makes me send sms or another code?

android sms

2022-09-22 22:14

1 Answers

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("sms:"
                        + + phoneNumber)));

PhoneNumber is the mobile number you want to send.

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + phoneNumber));     
intent.putExtra("sms_body", message); 
startActivity(intent);

You can do it like this.


2022-09-22 22:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.