通过Facebook上的分享

时间:2015-10-20 08:00:49

标签: android facebook share

我正在尝试在Android中分享内容,使用这样的意图ACTION_SEND:

public void onClick(View v) {
    Intent share = new Intent(android.content.Intent.ACTION_SEND);
    share.setType("text/plain");
    share.putExtra(Intent.EXTRA_TEXT, content);
    startActivity(Intent.createChooser(share, "Сонгох"));
}

使用Android意图在Facebook上分享时未显示消息

1 个答案:

答案 0 :(得分:1)

希望以下代码可以帮助您。

Facebook应用分享工作是分享只有没有文字的链接:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "http://www.google.com/");
startActivity(Intent.createChooser(intent, "Share with"));