I have a complicated structure to be displayed on the screen. Made with XML layouts. For the vertical orientation and portrait layouts are different.
If you flip the screen layouts are redrawn and initializes the GUI. On the horizontal layout I use CustomRelativeLayout, in which overrides onMeasure ().
After a few quick revolutions display an error message from java.lang.RuntimeException: Unable to start activity ComponentInfo android.view.InflateException: Binary XML file line #146: Error inflating class This link goes to the element of my CustomRelativeLayout and lower Caused by: java.lang.reflect.InvocationTargetException with reference to the constructor of my custom class.
I suspect that activity simply has no time to be destroyed and start again, but how to fix it I have not the foggiest idea. I would be grateful for your help.