New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking.sendIntent startActivity from outside of an Activity context error #28934
Comments
Another possible fix is to use |
Going to work on that. I'm going to the same thing as it's in |
The same error if you try to use other system activities like a dialog asking the user to enable Bluetooth:
|
Summary: Addresses #28934 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - When sending OS intents, always set "FLAG_ACTIVITY_NEW_TASK" flag (required by OS). Pull Request resolved: #29000 Test Plan: 1. Open RNTester on Android 2. Go to Linking section 3. Try opening "POWER_USAGE_SUMMARY" intent 4. App should open settings, instead of crashing Reviewed By: cortinico Differential Revision: D30876645 Pulled By: lunaleaps fbshipit-source-id: e427bfeadf9fb1ae38bf05bfeafd88e6776d71de
I am also facing same issue. |
This is now pulled into FB repo |
Any update on this issue? I just ran into the same when linking to android's WiFi settings:
Looks like it was merged #29000? In what release will it go out in? |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Summary: Addresses facebook#28934 <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - When sending OS intents, always set "FLAG_ACTIVITY_NEW_TASK" flag (required by OS). Pull Request resolved: facebook#29000 Test Plan: 1. Open RNTester on Android 2. Go to Linking section 3. Try opening "POWER_USAGE_SUMMARY" intent 4. App should open settings, instead of crashing Reviewed By: cortinico Differential Revision: D30876645 Pulled By: lunaleaps fbshipit-source-id: e427bfeadf9fb1ae38bf05bfeafd88e6776d71de
Description
I am trying to open security settings on android using Linking module :
Linking.sendIntent("android.settings.SECURITY_SETTINGS");
This result to this red box error:
React Native version:
React Native : 0.61.5
System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 26.83 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
Steps To Reproduce
Linking.sendIntent("android.settings.SECURITY_SETTINGS");
in Android (9 in my test)Expected Results
Security settings should open without error.
Suggestion
Add
FLAG_ACTIVITY_NEW_TASK
flag by default on indent or add ability onsendIntent
to add flags.The text was updated successfully, but these errors were encountered: