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.
InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. The constructor of your custom class is throwing an exception. You need to look at the exception nested within the InvocationTargetException in order to figure out which exception your class is throwing.