Can somebody explain why the onCreate()
and onCreateView()
are being invoked so many times which increments with each orientation change?
Here
An orientation change causes the system to go through the process of saving instance state, pausing, stopping, destroying, and then creating a new instance of the activity with the saved state. So this is the reason why there is so much onCreate and onCreateView calls.
I do not think the if (savedInstanceState == null)
condition in the onCreate
method is a good idea; the state-saving mechanism will not work properly...