Android 8.1.0 and screen orientation

460 views
Skip to first unread message

MM B

unread,
Oct 28, 2017, 11:13:56 AM10/28/17
to MIT App Inventor Forum
Has anyone else noticed some very odd behaviour in compiled apps that use different screens and specific screen orientation modes while using the new Android 8.1.0 release?
I have apps created in app Inventor which work correctly in Android 8.0.0 (and earlier) but not in 8.1.0. In each of my cases (I have at least two apps) which switch screens to a fixed landscape mode and return to a screen in portrait mode. Initially all is okay but about a second later (after returning to the portrait mode screen),the screen switches back to landscape mode and only pressing a menu option will switch the screen back to the correct portrait mode.
I've tried putting in a routine when you return from the landscape screen, to force portrait mode but this has no effect. Would be really interested to hear from others who have screen switching and orientation modes who see similar behaviour in Android 8.1.0 only.
Thanks,
MMB.

Peter Mathijssen

unread,
Oct 29, 2017, 12:21:32 PM10/29/17
to MIT App Inventor Forum
Could you post a aia with this behaviour? I have also 8.1 Beta on a nexus 5x and would like to test it.

MM B

unread,
Oct 30, 2017, 9:19:46 AM10/30/17
to MIT App Inventor Forum
See attached but you won't see the behaviour while connected via Companion application. You need to build/compile to .apk to see the strange behaviour on Android 8.1.0.

As a workaround, I now include a screen orientation change (in the current screen) just before closing this screen and returning to the original screen - seems to work without any additional effects being displayed...
So something like this: -

Screen1 (Fixed to Portrait Mode)  >> press button to switch to Screen2 (Fixed to Landscape Mode) >> press button to switch back to Screen1 (change orientation before closing this screen) >> Screen1 (Fixed to Portrait Mode) displayed correctly.

MMB.

PortraitLandscapeTest.aia

Peter Mathijssen

unread,
Oct 30, 2017, 10:26:17 AM10/30/17
to mitappinv...@googlegroups.com
I tested the aia with AI2, Makeroid, Thunkable and Appybuilder Gold. 

They all show the same behaviour as you have described in your first post. 

I guess the problem is with this procedure:


It works when i change the Button_click event in screen 2 to: 


Now the orientation isn't flipped back as described. 


I then used the tribblehunters multiple screen method so i looks like this. This also works ok. 


You can find more info at https://puravidaapps.com/tribblehunter.php




Peter Mathijssen

unread,
Oct 30, 2017, 5:15:40 PM10/30/17
to MIT App Inventor Forum
Response from MMB via mail. Please use this forum so all answers are archived for further use:

Thanks for the additional checks Peter. I will consider tribblehunters multiple screen method as well now that it seems the procedure I was using (close the screen only), is broken in 8.1.0.
Thanks for your help.
MMB.

Evan Patton

unread,
Oct 30, 2017, 5:27:13 PM10/30/17
to MIT App Inventor Forum
I've filed this as issue 976 for us to look into. It's unclear why the behavior would have changed in a point update in Android.

Regards,
Evan

Reply all
Reply to author
Forward
0 new messages