Reputation: 81
Good Day,
Im building an android app with a function of sharing a text message through whatsapp. Here is my code:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, message.toString());
intent.setType("text/plain");
intent.setPackage("com.whatsapp");
startActivity(Intent.createChooser(intent,""));
The code is working and I can share the message by choosing a contact and pressing send button in whatsapp.
My only problem is I need to go back from my activity and must know whether the message was successfully sent or not.
Any idea?
Thanks in advance.
Upvotes: 1
Views: 746
Reputation: 27535
whether the message was successfully sent or not.
Answer is No because WhatsApp does not have any api.
Upvotes: 1