6 comments

[ 3.3 ms ] story [ 22.7 ms ] thread
It’s funny that they list support for screen rotation as a key feature, as if this is some kind of rocket science... but they’re totally right to do so, because on Android it is rocket science at times!

I’ve never properly understood why mobile screen rotation needs to be so much more difficult to handle than desktop window resizing.

You can disable activity restart on screen rotation but you shouldn't because if your app can't handle that it won't be able to handle any number of other config changes (UI density, font settings, localization etc.) to say nothing of restarting gracefully when Android force stops it in the background.

Really the issue is websites and desktop programs have the expectation of being always running and in-memory until they choose not to be.

Not to say that the way Google decided to handle these issues in Android is in any way ideal. And CSS for all its warts has far better support for responsive design than the stock Android layout system.

If I could choose between "fast rotates, all apps crash/are killed on OS level font settings changes" or "slower rotates, apps gracefully handle OS level font settings changes" I feel like the former is clearly way preferable to the latter. Do you really feel differently?
It's not a matter of speed, it's a matter of preventing the app from losing state, background tasks, timers, notifications etc. whenever you do something as normal as take a call and browse the web before trying to go back to the app at hand. If it can't handle config changes it will crash a lot, sometimes even when not fully backgrounded.

That being said there are plenty of apps (video players for instance) that disable config changes on rotate as to more quickly switch between orientations. They still need to handle config changes properly for times like when the app is put into the background, and sometime later restored in a different orientation.