-2

Upon clicking some view in my app, How to send data via Whatsapp.

If WhatsApp is installed, it should be opened or else Google Play Store should be opened to facilitate WhatsApp installation.

Abhimanyu
  • 1,720
  • 1
  • 11
  • 35

1 Answers1

0

I guess this is what you're looking for.

Allowing Other Apps to Start Your Activity

Check this link for info.

The implementation of this is very easy, you can even get Intent type in your activity, using this:

Intent mIntent = getIntent();
Uri data = mIntent.getData();

// Figure out what to do based on the intent type
if (mIntent.getType().indexOf("image/") != -1) {
    // Handle intents with image data ...
} else if (mIntent.getType().equals("text/plain")) {
    // Handle intents with text ...
}

Also, do some research on Google before posting a question, these things are answered before.