您好我正在尝试使用结构库中的TweetComposer来发送照片。但是,一旦要求Twitter的意图,twitter崩溃就不会提供任何错误消息。我希望其他人有类似的经历吗?这是我正在使用的代码。
File newFile = new File(getContext().getFilesDir(), "snapshot.jpg");
try {
FileOutputStream fos = new FileOutputStream(newFile);
b.compress(Bitmap.CompressFormat.JPEG,50,fos);
fos.close();
}
catch(Exception e)
{
}
TweetComposer.Builder builder = new TweetComposer.Builder(getActivity()).text("TWEEEET")
.image(Uri.fromFile(newFile));
builder.show();
当我不添加图像时它确实有效!
添加图片时,Twitter会显示不支持的媒体错误。
谢谢!
答案 0 :(得分:0)
是的,我设法解决了!原来我试图分享一个回收的位图!