Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android twitter4j能否从一条推文中获取多张图片?_Android_Twitter_Twitter4j - Fatal编程技术网

Android twitter4j能否从一条推文中获取多张图片?

Android twitter4j能否从一条推文中获取多张图片?,android,twitter,twitter4j,Android,Twitter,Twitter4j,我是twitter4j的新手,我试着获取一些tweet,除了有多张图片的tweet外,一切都很好 例如,如果我同时推送4张图片(是的,现在推特允许我们从他们的移动应用程序推送最多4张图片),我只能获取第一张图片。以下是我的代码: for (twitter4j.Status status : result.getTweets()) { if (status.getMediaEntities() != null) {

我是twitter4j的新手,我试着获取一些tweet,除了有多张图片的tweet外,一切都很好

例如,如果我同时推送4张图片(是的,现在推特允许我们从他们的移动应用程序推送最多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
                    }   
            }
        }

谢谢您的帮助。

只需使用
status.getExtendedMediaEntities()