Open a chat
Open a chat with a predefined message.
Please note that the decision to send the message lies ultimately with the user.
The logic is placed onButtonClick... so I can send a message when a the button is clicked.
In the first example we use an intent and then we setdata to the contents of edittext1. Just in case the image isn't clear enough, the text is:
whatsapp://send?text=
WhatsApp.setAction(Intent.ACTION_VIEW);
WhatsApp.setData(Uri.parse("whatsapp://send?text=".concat(edittext2.getText().toString())));
startActivity(WhatsApp);
©2024 Sketchub | User Policy