Changing orientation crashes on targetSDKVersion 15


more timewasting; on target 15, changing orientation crashes. 11 is fine. Note, this is still building against min of 11.

so according to the internet, we need this:

which also breaks < 13.

However, in my case i get the dreaded “Error: String types not allowed (at ‘configChanges’ with value …)”. dont know why.

well, its back to target 11 for a while then. they’ve really screwed up this orientation thing, it’s a never ending source of PITA. Also, If you’re doing openGL, i recommend locking the orientation or else you’ll go insane.

I know this is an old topic, but the problem is biting me now.

I modified the manifest as indicated above, and I get an “onConfigurationChanged”. The app doesn’t crash now, but it also doesn’t get any notification that the size of the screen was modified (no size message).

So it just uses the existing (e.g. portrait) layout even though the device is now in landscape.

BTW, this was fine on older machines, but the newer versions crash without this configChanges modification.

Has anyone worked through this?

I’m calling “setScreenSize()” with the width/height/dpi after the config change. But it’s not refreshing the display as I expect - no size callbacks happen).

Perhaps it’s because the “displays” haven’t changed, internally?

I’ve managed to work around the problem by calling ‘onResume()’ after I’ve set the screen size, and in my application resume handler I set the window fullscreen (it was fullscreen before as well, obviously).

This works, at least.

So now I have a better solution. I added a “changeOrientation” native callback, and instead of doing ‘onResume()’, I call my changeOrientation() callback.

That code then sends a message which anyone who cares about can hook. In my case, I set the fullscreen mode in my app, regardless of orientation.