Change Layout/UI element order on Component Tree Programatically
<p>so, to the point, i'm right now working on a simple app, and for the app to working as intended i need to change my layout order on the component tree which hold different UI element</p>

<p><a href="https://i.stack.imgur.com/ryx0d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ryx0d.png" alt="enter image description here"></a>
need to move the relative2 layout to above relative1</p>

<p>i know that it tied to the XML file, but is it possible to do that without much hassle?</p>

<p>found this link before : <a href="https://stackoverflow.com/questions/3277196/can-i-set-androidlayout-below-at-runtime-programmatically">Can I set &quot;android:layout_below&quot; at runtime, programmatically?</a></p>

<p>i already tried it, but it make my app crash when i execute it, i don't even know if that is what i need</p>

<p>would be grateful if anyone can help, thanks!</p>