In Android, when the screen orientation changes (between landscape and portrait) the onCreate
method is called which ,if not handled properly, will recreate the entire activity when the result is too simply change the layout and retain all of the same information.
I know of a few ways to solve this, but I'm interested in the most efficient way.
1) Telling the manifest that I will handle the orientation change by overriding the onConfigurationChanged()
method and leaving it empty.
2) override onSaveInstanceState()
and save the data here to be repopulated in onCreate()
3) Override onPause()
which will create a bundle of the data and send it to onSaveInstanceState()
Obviously, these are all options, but which one is a better practice (small, medium, large amounts of data)
Thank you
res/layout-land
folder. Unless of course it is too much overhead for a simple activity. – Hexangular