【问题标题】:Can twitter4j fetch more than 1 picture from a tweet?twitter4j 可以从推文中获取超过 1 张图片吗?
【发布时间】:2014-12-28 21:14:44
【问题描述】:

我是 twitter4j 的新手,我尝试获取几条推文,除了带有多张图片的推文外,一切都很好。

例如,如果我同时发布 4 张图片(是的,现在 twitter 允许我们从他们的移动应用程序中发布最多 4 张图片),我只能获取第一张图片。这是我的代码:

        for (twitter4j.Status status : result.getTweets()) {
            if (status.getMediaEntities() != null)
            {
                    for (MediaEntity media : status.getMediaEntities())
                    {
                        //for some reason getMediaEntities() return an array with the first pic uploaded only
                    }   
            }
        }

感谢您的帮助。

【问题讨论】:

    标签: android twitter twitter4j


    【解决方案1】:

    只需使用status.getExtendedMediaEntities()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-10
      • 2014-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-11
      相关资源
      最近更新 更多