2012-12-22 77 views
5

現在我想用以下鏈接共享文本的鏈接分享的文字是我的代碼無法通過Android的分享意圖

String myText = "Hey!\nThis is a my Text!"; 

Intent share = new Intent(Intent.ACTION_SEND); 
share.setType("text/plain"); 
String extraText = "www.mylink.com\n\n" + myText ; 
share.putExtra(Intent.EXTRA_TEXT, extraText); 
startActivity(Intent.createChooser(share, "Share with Friends")); 

所以它的工作做工精細與Gmail,微博等,但它無法正常工作對正在使用Facebook

它僅共享鏈接,但有沒有顯示我的文字

我想這種類型的共享

www.mylink.com 

here is my text 

任何幫助,將不勝感激, 在此先感謝。

+0

[Android和Facebook共享意圖]的可能重複(http://stackoverflow.com/questions/7545254/android-and-facebook-share-intent) –

+0

這是我的解決方案,它只是用於共享URL上Facebook,http://stackoverflow.com/a/29529335/513413 – Hesam

+0

[他在這裏的問題可能是Facebook沒有看到意圖中提供的額外信息。因爲它適用於Gmail和Twitter。](https://stackoverflow.com/questions/34618514/share-text-via-intent-on-facebook-without-using-facebook-sdk) –

回答

1

使用共享意向, 你必須設法做的牆後這個FB圖形API上FB文本你不能共享鏈接。