I'm trying to implement logging in with twitter in my app. I just came across news that states that Fabric was sold to Google. I am not using Fabric in my application. Instead I am using the twitter core sdk com.twitter.sdk.android:twitter-core:3.1.1 . I try to initialise Twitter but the login button is still greyed out with this code:
TwitterConfig config = new TwitterConfig.Builder(this)
.logger(new DefaultLogger(Log.DEBUG))
.twitterAuthConfig(new TwitterAuthConfig(getString(R.string.twitter_key), getString(R.string.twitter_secret)))
.debug(true)
.build();
Twitter.initialize(config);
I see the following error output in my logcatE/Twitter: Must initialize Twitter before using getInstance()
How can I go about this error?
To solve the problem, I took my
Twitter.initialize(TwitterConfig)statement before Android'ssetContentView()method and problem solved:Sample Code