Portrait screen orientation is not locked properly on Android 8.1
See original GitHub issueEnvironment
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 393.55 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.12.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 26.0.2, 26.0.3, 27.0.3, 28.0.2
System Images: android-24 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1
Description
Preconditions:
- You must have android device with 27 API
- I created new App via react-native init appName
- Added this option in my AndroidManifest.xml to .MainActivity
android:screenOrientation="portrait"
- Added button with some deeplink
Linking.openURL('https://www.google.com/maps/dir/api=1&travelmode=driving&origin=10,11&destination=12,11');
Steps:
- Rotate phone in landscape
- Open a new app with deeplink
- Go back to your app
Actual result: 3 rotations before we will see proper portrait screen orientation. Expected result: one rotation directly in portrait screen orientation without others.
Repo with this bug: https://github.com/andrej-kuznetsov/screenRotationRNBug
Reproducible Demo
Follow above instructions or this video: https://drive.google.com/open?id=1Y989iGoFLu4PZUcKvuBSiS4Wiwv_At1p
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Android 8.1 screen orientation issue: flipping to landscape ...
I found that on Android 8.1 every time I open the video activity and close it the previous activity go to landscape even...
Read more >Android 8.1 screen rotation [69168442] - Issue Tracker - Google
What you think the correct behavior should be. - The portrait activity should stay portrait and don't flip every time when I finish...
Read more >Screen Orientation Quick Flip - Bugs
But if holding in landscape position & screen orientation is set to portrait, flipping behaviour of next screen is observed as you mentioned....
Read more >Lock Screen to Portrait or Landscape With Lock Button on ...
See how you can lock the screen to portrait or landscape mode using the lock button on Android smartphone. Android Pie 9.
Read more >MDM Android Enterprise Screen orinetation lock on device ...
Hi Team, We have a issue with setting Android device screen orientation in MDM to stay in portrait mode regardless of the way...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve followed the exacts same step as the video and the bug doesn’t occur on my side so we’ll close this issue.
Tested on android 8.0, with your repro folder. If you manage to submit another repro that would be broken on both side, we’ll be happy to open this again.
In the title of this issue - “… on Android 8.1”