我使用intent和Action.SEND在WhatsApp,twitter,Facebook和GMail等社交網絡上共享我的自定義消息。除了Facebook之外,Gmail和其他應用程序都可以使用!我如何自定義我的代碼以在Facebook上分享內容?我使用Facebook SDK在Facebook上分享,沒有問題,但我想用意圖來做。在FaceBook上共享內容Android
這是我使用:
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"));
這隻適用於Android 4.0 – Giorgi