Reputation: 2334
I've set up Fabric and a log in button in Android Studio using the guide from the docs and now want to fetch the logged in user's twitter feed such as on the official app.
How do I implement this? The official docs mention using the REST API but don't show a way to add the homeTimeline
to a GridView/ListView adapter..
Upvotes: 0
Views: 714
Reputation: 177
Even is an old question and hopefully you've found the solution, i post the answer as i think the Fabric Twitter Android Documentation i's a ____ Maybe this method i use can help you
public void getTweets(){
TwitterApiClient twitterApiClient = TwitterCore.getInstance().getApiClient();
twitterApiClient.getStatusesService().homeTimeline(null, null, null, null,null,null, null, new Callback <List<Tweet>>() {
@Override
public void success(Result<List<Tweet>> listResult) {
tweets = listResult.data;
final FixedTweetTimeline userTimeline = new FixedTweetTimeline.Builder()
.setTweets(tweets)
.build();
adapter = new CustomTweetTimelineListAdapter(TimelineActivity.this, userTimeline);
setListAdapter(adapter);
}
@Override
public void failure(TwitterException e) {
Log.d("Twitter","twitter " + e );
}
});
}
Upvotes: 1