Atula Atula - 6 months ago 34
Java Question

Get Tweets with Fabric

Can Anybody tell me how to get Tweets by using

fabric sdk
?

I have tried the official link, but getting errors.

So I need a way to use the code for Showing Tweets in different activity as I am already doing a lot in my MainActivity.


errors are random like

"import com.twitter.sdk.android.tweetui.TweetViewFetchAdapter;" is depreciated.

no loop using import android.support.v7.app.AppCompatActivity;


Actually I have tried a lot of things so getting different errors

Regards.

Answer

ok I have found out the way out.
We can do it in two ways either use Default fabric twitter adapter for timeline or make a custom adapter.
Here, I am using the default way

final UserTimeline userTimeline = new UserTimeline.Builder()
                    .screenName(userScreenName).build(); //creating user timeline

final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter.Builder(this)
 .setTimeline(userTimeline).build(); 

setListAdapter(adapter); //adapter for fetching tweets

NOTE: userScreenName can be fetched on successfull login.