0
我正在嘗試使用ACTION_SEND意圖通過任何可以發佈我選擇的文本來共享我的應用程序。無法與ACTION_SEND共享預先設置的文本到社交
我用這個代碼
public void sharebutton(View v){
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("<p>Try this android application https://link...</p>"));
startActivity(Intent.createChooser(sharingIntent,"Share by"));
}
例如,我要選擇Facebook和它應該加載的Facebook應用程序,並在文本字段應該是:「試試這個Android應用程序https://link ...」 但相反,它要麼犯規表明我要通過Facebook分享,如果我使用的選項sharingIntent.setType("text/html");
(它顯示電子郵件,Dropbox和blootooth)或不放置文本里面,如果我使用sharingIntent.setType("text/plain");
對我有一個解決方案嗎?隨時提供幫助。
您是__not allowed__預填充的消息部分請參閱[平臺政策](https://developers.facebook.com/policy#control)。該消息必須是100%用戶生成的,即由用戶自己輸入。 – CBroe
哦,我可以以不同方式分享我的應用程序嗎? – lalilei
您可以讓用戶分享鏈接......但您必須允許他們自己輸入消息。 – CBroe