How do i get a ArrayList<Tweet> from a users timeline?




i would like to integrate my twitter tweets to my own adapter.

Using the TweetTimelineListAdapter is no option because i will create a global timeline with a few other elements, but i didn’t find a way to get the tweets from

UserTimeline userTimeline = new UserTimeline.Builder().screenName("blahblah").build();

into a ArrayList.

Hope someone can help me.


@Nico_DreamzZ Happy to help - can you share more about the type of timeline you’re trying to make? For example, what is a “Global Timeline”?


@bonnell thanks for your reply.

With a global timeline i mean, that not only tweets are shown is my list. There are forum posts from a rss feed an messages from Facebook. You should be possible to see all activity from the project I’m developing a app for.


To realize this timeline i written an own adapter for the recycler view and now i need a list of the tweets out of the user timeline.


Yes, using your own adapter in this case would be a good way to handle this. Alternatively, create a collection and use the collection timeline.


My only problem is to get all tweets from the “UserTimeline” object into a arraylist :confused:


Yes, there isn’t a default option for that conversion, alternatively, you could use the REST API:


Yes this will maybe an option, but there must be also a way to get all tweets through the api.


I got it working, after 5 hours playing with the timeline object :smiley:

For someone who also needs the tweets of a timeline:, new Callback<TimelineResult<Tweet>>() { @Override public void success(Result<TimelineResult<Tweet>> result) { for(Tweet tweet :{ tweets.add(tweet); } } @Override public void failure(TwitterException exception) { exception.printStackTrace(); } });


Thanks for sharing your solution @Nico_DreamzZ and happy coding!


Thank you so much! this was very helpful.

closed #12