Android按钮从textview共享文本

时间:2012-12-02 19:55:56

标签: android textview

我需要分享按钮以这种方式在textView中共享文本,我是java和android的初学者

explanation http://i48.tinypic.com/hw0q42.png

4 个答案:

答案 0 :(得分:11)

on Button Click

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"Your score and Some extra text");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The title");
startActivity(Intent.createChooser(shareIntent, "Share..."));

答案 1 :(得分:3)

创建一个将在分享按钮上调用并在其中添加此行的方法

Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
startActivity(Intent.createChooser(sharingIntent, "Share via"));

也请尝试此link

干杯

答案 2 :(得分:1)

看看如何使用启动Share Via对话框的Intent。

看到这篇文章有你的答案: Android Share Via Dialog

答案 3 :(得分:1)