Android twitter sdk 使用fabric 获取特定用户的公开推文 [英] Android twitter sdk using fabric Get public tweets of particular user

查看:30
本文介绍了Android twitter sdk 使用fabric 获取特定用户的公开推文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在处理 twitter 集成时遇到了一个小问题.我用过 Fabric .

Hello Guys I am facing a small trouble while working on twitter integration. I have used Fabric .

private void loadTweet(){
    final List<Long> tweetIds = Arrays.asList(510908133917487104L);
    TweetUtils.loadTweets(tweetIds, new Callback<List<Tweet>>() {

        @Override
        public void success(Result<List<Tweet>> result) {
            for (Tweet tweet : result.data) {
                tweeterLayout.setTweet(tweet);
            }
        }

        @Override
        public void failure(TwitterException e) {
            Log.v("Exception","TwitterException");
        }
    });

}

如果我传递推文 ID,这个方法对我来说很好用.但我想获得特定用户的公开推文.如果我传递某人的 ID(@user_id"),那么我可以获取他的推文吗?

This method works fine for me if I pass a tweet ID. But I want to get public tweets of a particular user. any way around if I pass someone's ID ("@user_id") then I can fetch his tweets?

推荐答案

是的,您可以检索用户的时间线.

Yes, you can retrieve a user's timeline.

String twitter_account = "jack";

final UserTimeline userTimeline = new UserTimeline.Builder()
    .screenName(twitter_account)
    .build();
final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter.Builder(getActivity())
    .setTimeline(userTimeline)
    .build();

setListAdapter(adapter);

这篇关于Android twitter sdk 使用fabric 获取特定用户的公开推文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆