【问题标题】:Share photo to twitter from Android从 Android 将照片分享到 Twitter
【发布时间】:2016-01-30 19:24:23
【问题描述】:

您好,我正在尝试使用织物库中的 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 在添加图片时出现不支持的媒体错误。

谢谢!

【问题讨论】:

    标签: android android-intent twitter share twitter-fabric


    【解决方案1】:

    好吧,我设法解决了!原来我是想分享一张回收的位图!

    【讨论】:

      猜你喜欢
      • 2012-03-11
      • 1970-01-01
      • 1970-01-01
      • 2012-05-18
      • 1970-01-01
      • 2015-05-15
      • 2011-09-29
      • 1970-01-01
      • 2014-05-17
      相关资源
      最近更新 更多