0

I am using the code below.

Intent sendIntent = new Intent(Intent.ACTION_SENDTO);         
            sendIntent.setData(Uri.parse("smsto:" + phno));
            sendIntent.putExtra("sms_body", msg);
            sendIntent.putExtra("exit_on_sent", true);
            startActivity(sendIntent);

What should I add more?

donison24x7
  • 304
  • 1
  • 15

1 Answers1

0

You are looking for Share via Intent, something like:

Intent intent=new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
//the line below is optional
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

// Add data to the intent, the receiving app will decide what to do with it.
intent.putExtra(Intent.EXTRA_SUBJECT, “Some Subject Line”);
intent.putExtra(Intent.EXTRA_TEXT, “Body of the message”);  

Also, you can use createChooser():

startActivity(Intent.createChooser(intent, “How do you want to share?”));

Refer:
How to filter specific apps for ACTION_SEND intent (and set a different text for each app)

http://android-developers.blogspot.in/2012/02/share-with-intents.html

Check this too:
http://developer.android.com/training/sharing/send.html

Community
  • 1
  • 1
Pararth
  • 8,114
  • 4
  • 34
  • 51
  • @donison24x7 you will have to search a bit for your implementation, else the code that i have mentioned should work, just to check how the call takes place – Pararth Mar 12 '14 at 10:07