Skip to content Skip to sidebar Skip to footer

Android Twitter 4j Integration Get Tweet Entities

I am working on twitter integration with android using Twiitter4j. I am trying to fetch Home timelines and its working fine. But when i am looking to get urls included in the twee

Solution 1:

You just need to add one more line while creating object of ConfigurationBuilder

cb.setIncludeEntitiesEnabled(true);

(Hint for the next code)And you will get the Entities then,

ResponseList<Status> list = twitter.getHomeTimeline();
URLEntity[] uent = list.get(0).getURLEntities();
if (uent != null) {
                    for (int k = 0; k < uent.length; k++) {
                        Log.i("URL Entity", "Dp Url " + uent[k].getDisplayURL()
                                + " URL " + uent[k].getURL() + " start "
                                + uent[k].getStart() + " end "
                                + uent[k].getEnd());
                    }
}

Post a Comment for "Android Twitter 4j Integration Get Tweet Entities"