InvocationTargetException in constructor of a custom class
<p>I have a complicated structure to be displayed on the screen. Made with XML layouts. For the vertical orientation and portrait layouts are different.</p>

<p>If you flip the screen layouts are redrawn and initializes the GUI. On the horizontal layout I use <strong>CustomRelativeLayout</strong>, in which overrides <strong>onMeasure ()</strong>.</p>

<p>After a few quick revolutions display an error message from <strong>java.lang.RuntimeException: Unable to start activity ComponentInfo android.view.InflateException: Binary XML file line #146: Error inflating class </strong> This link goes to the element of my CustomRelativeLayout and lower <strong>Caused by: java.lang.reflect.InvocationTargetException</strong> with reference to the constructor of my custom class.</p>

<p>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.</p>
