1

Here I am trying to send the message hello world to a number. Here is My code snippet:

public void openWhatsappContact(String number) {

    Uri uri = Uri.parse("smsto:" + number);

    Intent i = new Intent(Intent.ACTION_SENDTO,uri);

    i.setType("text/plain");

    i.putExtra(Intent.EXTRA_TEXT, "Hello World");

    i.putExtra("chat",true);

    i.setPackage("com.whatsapp");  

    startActivity(Intent.createChooser(i, ""));

}

But its showing error:

No applications can perform this action 
Mohammed H
  • 6,880
  • 16
  • 81
  • 127
Taj Mb
  • 61
  • 5
  • and is it certainly installed? try to use the code from http://stackoverflow.com/questions/15462874/sending-message-through-whatsapp it tests if whatsapp is installed by using packagemanager – Gabriel H Jan 07 '15 at 09:06
  • Same for me. Whatsapp is installed on my device – rahulserver Mar 28 '15 at 01:49

0 Answers0