0

I'm working on an Android application, where I have to show an specific timeline. Well I have added fabric.io and I also created a twitter app(I mean I got the keys). So I really don't know how can I get the twitts on my class to display them on my listview. let see the code below:

TwitterAuthConfig authConf =
                new TwitterAuthConfig(this.getResources().getString(R.string.consumerKey),
                        this.getResources().getString(R.string.consumerSecret));
        Fabric.with(this, new Twitter(authConfig));

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

So, how can I grab the tweets from the userTimeline. Maybe I'm confuse and I'm implementing it wrong.

1

The UserTimeline can be passed to the TweetTimelineListAdapter. The TweetTimelineListAdapter can be used on any ListView.

From the docs: http://docs.fabric.io/android/twitter/show-timelines.html#listactivity

import com.twitter.sdk.android.tweetui.TweetTimelineListAdapter;
import com.twitter.sdk.android.tweetui.UserTimeline;

public class TimelineActivity extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.timeline);

        final UserTimeline userTimeline = new UserTimeline.Builder()
            .screenName("fabric")
            .build();
        final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter(this, userTimeline);
        setListAdapter(adapter);
    }
}
0

You can use http://docs.fabric.io/android/twitter/show-timelines.html#listactivity fabric documentation. All of you need is found fabric documentation. But if you want use your own adapter (custom adapter) you can use this github-gist-link. https://gist.github.com/sabadow/a7dd2575325b676a113e

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.