I want to display timeline using a particular screenName
i am getting this error:-
Must Initialize Fabric before using singleton()
By the way ,I am suppose to use automatic guest authentication. Here is my Java code:-
import android.app.ListActivity;
import android.os.Bundle;
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(); //HERE I AM GETTING THIS ERROR
final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter(this, userTimeline);
setListAdapter(adapter);
}
}
I got it solved by myself. Just add below two lines . Do n't forget to edit and paste your Consumer Key (API Key) & Consumer Secret (API Secret).
TwitterAuthConfig authConfig = new TwitterAuthConfig("add your Consumer Key (API Key) ", "Consumer Secret (API Secret)");
Fabric.with(this, new TwitterCore(authConfig), new TweetUi());
before
final UserTimeline userTimeline = new UserTimeline.Builder().screenName("fabric").build()
Add this Acitvity onCreate metod
Fabric.with(this, new Crashlytics());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With