问题
How can implement an intent for sharing some text in a dialog like this ?

回答1:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(filePath));
try
{
startActivity(Intent.createChooser(intent, "Sending File..."));
}
回答2:
There u are:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, YOUR_TEXT_TO_SEND);
startActivity(Intent.createChooser(intent, "Share with"));
回答3:
You can also use my library Android Intents. See demo app for details
来源:https://stackoverflow.com/questions/9517545/android-share-intent