我想通过共享意图,将带有预先填充标题的照片与我的应用程序分享到Facebook上。
我知道如何分享照片或分享文本,但如何同时分享它们呢?
示例代码:
如果设置类型为
我猜测问题是安卓版Facebook应用程序在过滤类型为
我知道如何分享照片或分享文本,但如何同时分享它们呢?
示例代码:
Intent shareCaptionIntent = new Intent(Intent.ACTION_SEND);
shareCaptionIntent.setType("image/*");
//set photo
shareCaptionIntent.setData(examplePhoto);
shareCaptionIntent.putExtra(Intent.EXTRA_STREAM, examplePhoto);
//set caption
shareCaptionIntent.putExtra(Intent.EXTRA_TEXT, "example caption");
shareCaptionIntent.putExtra(Intent.EXTRA_SUBJECT, "example caption");
startActivity(Intent.createChooser(shareCaptionIntent,getString(R.string.share)));
如果设置类型为
image/*
,则上传的照片不会预填标题。如果设置为text/plain
,则只上传标题而不上传照片.....
我猜测问题是安卓版Facebook应用程序在过滤类型为
image/*
的ACTION_SEND
意图进行上传照片时没有查找Intent.EXTRA_TEXT
。因此,如果安卓版Facebook应用程序查找该值并插入到图片的说明中,则可以解决此问题。