我必須將圖片與文字共享到所有社交媒體。所以我嘗試了下面的代碼: -Android共享意圖在某些應用程序中不起作用
share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = imageUrl;
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/html");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, (String)
v.getTag(R.string.app_name));
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,
"Text for post");
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
context.startActivity(Intent.createChooser(shareIntent, "Share Using"));
}
});
它正在工作,現在我可以在應用程序中與gmail中的圖像共享文本。但問題是,即使我安裝並更新了所有這些應用程序,我仍無法通過使用此共享意圖獲取Facebook,Twitter和Instagram。
我需要讓所有的社交媒體應用程序共享。
被Facebook出現,但不能共享圖像使用「文本/純」作爲shareIntent型...
有人可以幫助我找到答案嗎?
在此先感謝。
做你嘗試\ */\ * –
對不起,不工作,只股份的文本。我必須分享文字和image.and還當我選擇了Facebook的分享它顯示空白文本:( – max
我已經得到像「http://example.com/image.jpg」字符串的圖像。所以我必須將其轉換爲Uri然後只有我必須通過圖像與文本參數共享社交媒體 – max