Android is just the Linux kernel on the phone -- that's the issue I have with it. It comes with none of the other stuff that makes GNU/Linux great: philosophically/socially it's different, but on a technical level it's missing rest of the GNU/Linux stack (e.g. package management, and the plethora of developer tools -- including languages and libraries). The GNU/Linux stack is developed by a diverse ecosystem of contractors, big and small business, and non-for-profits (e.g. Red Hat, Intel, Mozilla, Samsung, Canonical, Document Foundation, Fujitsu, Google, etc). Android is largely controlled by one company.
https://www.youtube.com/watch?v=ig9GKAFzDxQ
https://www.youtube.com/channel/UCthvmTSlmIcMH93LIJNe-2w/sea...
http://penguindreams.org/blog/android-fragmentation/
The TL;DR, Android needs to be fixed so ASOP can be installed on any phone, just like Linux/Windows. The current state is bizarre for what's essentially now a general purpose operating system.
If anything, Android is a fork of Linux.
This behavior is the default because it prevents developers from needing to think about their UI changing dimensions (including runtime screen size/density changes!)... but it's certainly not required by the framework.
If you set android:configChanges="orientation" in your application manifest, your app won't be automatically restarted. However, you'll become responsible for swapping out any UI resources at that point.
(Keep in mind that Android lets you declare completely different UI layouts and drawables for different device configurations, so depending on how you wrote your app, you may need to re-inflate part of your UI.)
Or just implement onSaveInstanceState() and let the OS do everything for you.
No, the framework uses it to let you automatically handle those changes, the reason it's there is because early Android devices were weak (obviously) and the pipe dream was that we'd write apps that didn't mind randomly getting their processes killed as long as we used onSaveInstanceState... man-centuries later and it's clear the dream didn't pan out. I wonder how many billions of NPEs it was worth to be able to say Android does what iOS don't (multitasking) back then.
And that android:configChanges line misses out on many other triggers that cause you to need to handle onSaveInstanceState (like someone plugging in a keyboard). Even with every flag set for configChanges you still need to implement onSaveInstanceState for process death to work as intended.
The Android framework really is garbage. I might be biased though, I spent the day trying to trick it into not going to 7(!) FPS because our designers had the audacity to request we translate a video in an animation (and don't get me started on the insanity that is animations on Android [the X ways we've now gotten to do it which all have their own limitations]).
Moreover, it's not Linux if you have to use a Java API to do anything useful.
And everything to do regarding being a fork on the Java ecosystem, and I side with Oracle.
It remains to be seen if Brillo or Fuchsia will have any relevance on the market, even when coming from Google.