我使用 intent 和 Action.SEND 在 WhatsApp、twitter、Facebook 和 GMail 等社交网络上分享我的自定义消息。Gmail 和除 Facebook 以外的其他应用程序一切正常!如何自定义代码以在 Facebook 上分享内容?我确实使用 Facebook SDK 在 Facebook 上分享,但我想使用意图来做到这一点。
这就是我使用的:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, knowTitle+"Read the full article via MomsApp by EnfaMama A+ at http://meadjohnsonasia.com.my/mobileapp");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "I just read "+knowTitle);
sendIntent.setType("*/*");
startActivity(Intent.createChooser(sendIntent, "Share Your Favorite Article"));