I'm composing a Tweet in my app and then launching Twitter app to create that Tweet on user's profile. Following is the code for composing the Tweet and launching of Twitter app
TweetComposer.Builder builder = new TweetComposer.Builder(this).text(tweetText);
Intent intent = builder.createIntent();
startActivityForResult(intent, TWEET_REQUEST_CODE);
Then I read whether the Tweet was successully created or not through following code:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode = TWEET_REQUEST_CODE && resultCode == RESULT_OK) {
//do some operation
}
}
The problem is that I get resultCode = RESULT_CANCELED
in onActivityResult
instead of RESULT_OK
despite the Tweet successfully created in Twitter app and appearing on user's timeline and hence the question Why am I getting RESULT CANCELED instead of RESULT_OK? I have tried finding the cause of error by checking the data
object in onActivityResult
but it is null as well. Is there any other way of finding more about why the app is sending RESULT_CANCELED
?
Also, I'm not handling user login in my app and let Twitter app to handle that for me. Following is the setup code for Fabric:
TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
Fabric.with(this, new Twitter(authConfig), new TweetComposer());
Version of Twitter SDK: 2.3.2
Version of Twitter App: 6.48.0