Q:

Send Option in Android Application?

I have a application that has a text field, something like a sample notepad application. I want to have send option where I need to create intent to send the text to all possible applications like gmail, sms, facebook, twitter, etc... and i also want the other way also. I mean when the user clicks on send from other application they need to see my application as a option to receive text .
And In this operation if the application is a mail application for sending text to, example the gmail application, I want to have few files from my sd card attached to the mail. 
Please let me how to do this in my application. Thank you for your help and time. 

A:

For registering your app as a receiver you have to use an intent as this:
<intent-filter>
   <action android:name="android.intent.action.SEND" />
   <data android:mimeType="text/plain" />
</intent-filter>

About sharing look at the documentation:
http://developer.android.com/reference/android/content/Intent.html
You should wrap it in a chooser  (createChooser(Intent, CharSequence))
example:
Intent i=new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT, "hi");
i.putExtra(Intent.EXTRA_TEXT, "your data");
startActivity(Intent.createChooser(i, "example"));

