We are using com.twitter.sdk.android:twitter:1.8.0 android SDK for login.
From an Activity we are initiating the login authorize request. While clicking on login button, SDK automatically redirects to Twitter app for authentication. After user press “Allow” on the twitter page, application receives via onActivityResult. It works perfectly most of the time. But it was failing randomly. Following are the observations:
- When i click on login, Twitter app is getting launched. At that time, due to low memory situations, our app is getting killed.
- Once user gives permission our app is relaunched. As activity itself recreated, twitterauthclient object also recreated.
mTwitterAuthClient= new TwitterAuthClient();
3.OnActivityResult we get the response data and try to invoke
mTwitterAuthClient.onActivityResult(requestCode, resultCode, data);
We get following error
Twitter: Authorize not in progress
If the acitivity is not killed, SDK works perfectly. We get this problem only if activity is getting killed.
We are able to reproduce this problem, if you set Android settings->Developer options->Don’t keep activity.