I want to achieve Login with twitter inside fragment using TwitterAuthClient() how to solve
TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
Fabric.with(this, new Twitter(authConfig));
Code inside MyApplication .java
TwitterAuthClient authClient = new TwitterAuthClient();
authClient.authorize(TwitterSettingsActivity.this, new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> twitterSessionResult) {
Logger.e(TAG, "ok");
}
@Override
public void failure(TwitterException e) {
Logger.e(TAG, "failure error", e);
}
});
code inside onCreateView()
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Pass the activity result to the auth client.
authClient.onActivityResult(requestCode, resultCode, data);
}
These All the process working in activity but not in fragment so how to overcome these???