Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 20th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 601  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to call whatsapp as an Intent from my app on Android?
  2. Intent sendIntent = new Intent(Intent.ACTION_VIEW);
  3.             sendIntent.putExtra("sms_body", "The SMS text");
  4.             sendIntent.setType("vnd.android-dir/mms-sms");
  5.  
  6.             startActivity(sendIntent);
  7.        
  8. Intent i = new Intent(android.content.Intent.ACTION_SEND);
  9.  
  10. i.setType("text/plain");
  11. i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
  12. i.putExtra(Intent.EXTRA_TEXT, "Message body");
  13.  
  14. startActivity(Intent.createChooser(i, "Share dialog title"));