Search Issue Tracker

Won't Fix

Votes

0

Found in

2017.4.10f1

Issue ID

1093963

Regression

No

[Android] Landscape-Only Unity app doesn't update orientation after returning from a portrait app 8.1

Mobile

-

After returning from a portrait app (during ACTION_SEND, for example) into a Unity app that is locked to landscape orientation, the screen remains in portrait orientation on Android 8.1.

Steps to reproduce:
1. Open the app on an Android 8.1 device where instagram is installed and logged in
2. Note that the app is LANDSCAPE only, it will auto-rotate between landscape left and landscape right
3. Press share and choose the instagram 'direct' option
4. Instagram's share page will open in portrait mode
5. Press back to go back to the app
6. The app will now be stuck in portrait mode

Expected result: Unity app reverts to landscape orientation after returning from another app.
Actual result: Unity keeps the orientation from the previous app.

NOTE: this is an Android bug that has been fixed in Android 9. As a workaround, the following code can be added to the Update loop to fix the orientation:

void Update()
{
if (Screen.orientation == ScreenOrientation.Portrait)
Screen.SetResolution(0, 0, Screen.fullScreen);
}

Reproduced in: 2019.1.0a6, 2018.3.0b8, 2018.2.14f1, 2017.4.10f1, 2017.2.4f1

Tested devices:
Reproduced:
VLNQA00001, Google Pixel 2 (Pixel 2), Android 8.1.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
No repro:
VLNQA00124, Google Pixel 2 XL (Pixel 2 XL), Android 9, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00153, Google Pixel XL (Pixel XL), Android 8.0.0, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530
VLNQA00093, Samsung Galaxy S6 edge (SM-G925F), Android 7.0, CPU: Exynos 7 Octa 7420, GPU: Mali-T760 - app is killed and restarted getting back from Instagram

  1. Resolution Note:

    This is an Android bug, that can be worked around by adding the following code to Update():
    void Update()
    {
    if (Screen.orientation == ScreenOrientation.Portrait)
    Screen.SetResolution(0, 0, Screen.fullScreen);
    }

Comments (1)

  1. alexanne109

    Jul 14, 2020 08:03

    You should update the application again, maybe that version has been corrupted. I also encountered the same situation when updating the gb instagram app. You can also via https://techbigs.com/gb-instagram.html to update your application.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.