How to send messages with Android Studio-Java

Issue

my question is about Android Studio, in case someone knows how to open the message application that the android device brings to send a message when clicking on a button… I have an application developed in Android Studio with Java, which It registers contacts and I want that when a button is pressed that is to send messages, the application takes the phone number of the person to whom the button belongs and opens the phone messages application no need to send the message as a parameter.

I already did the function of making the call, but I couldn’t find examples that help me for what I want to do… I hope someone has some idea and helps me, thank you very much in advance.

Solution

String number = "12346556";  // The number 
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)));

Answered By – franvillacis

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published