You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2019. It is now read-only.
Implement TwitterTweet or TwitterTimeLine in your app
Open app on Android 6 or earlier
Share a tweet (press share icon)
Expected behaviour
Twitter app intent chooser to share the tweet
Actual behaviour
App crashes: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
I have created a PR which resolves this issue: #131
To reproduce you can use context.getApplicationContext() instead of context when creating the intent. This mimics the same behaviour as reactContext.
Please review my pull request. In our application we have about 50.000 Android users with Android 6 or lower. We really need this fix.
This happens in our React Native app. Possibly because the following method fails since the context is a react context and not an activity:
https://github.com/twitter/twitter-kit-android/blob/38aeae6c046fe2ba1074a1f0cbfaf7746a8c76ce/twitter-core/src/main/java/com/twitter/sdk/android/core/IntentUtils.java#L34
Steps to reproduce the problem
Expected behaviour
Twitter app intent chooser to share the tweet
Actual behaviour
App crashes:
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
Android API Version
Android 6 and prior
This can easily by adding the FLAG_ACTIVITY_NEW_TASK to the intents defined here:
https://github.com/twitter/twitter-kit-android/blob/c148862c612c66d0f2b50cac40adf4e3d287cb8b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/AbstractTweetView.java#L248
https://github.com/twitter/twitter-kit-android/blob/c148862c612c66d0f2b50cac40adf4e3d287cb8b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/ShareTweetAction.java#L51
The text was updated successfully, but these errors were encountered: