How to Change Layout with Another Layout Dynamically
<p>I've <code>main_layout.xml</code> as a root layout, does not matter it's <code>RelativeLayout</code> or <code>LinearLayout</code>. And that root layout has different layouts in its own. Basicly it's looking like this:</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/default_background" &gt;

    &lt;RelativeLayout 
        android:id="@+id/panel_bar"&gt;
        &lt;!-- --&gt;
    &lt;/RelativeLayout&gt;

    &lt;RelativeLayout
        android:id="@+id/other_bar"&gt;
    &lt;/RelativeLayout&gt;

    &lt;RelativeLayout
        android:id="@+id/main_bar"&gt;
        &lt;Button id="@+id/change_button" /&gt;
    &lt;/RelativeLayout&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>When I've clicked to <code>change_button</code> I want to change <code>panel_bar</code> with another layout, let's say <code>another_layout</code>. By the way, <code>another_layout</code> is an existing layout in a differet file. They are both (<code>panel_bar</code> and <code>another_layout</code>) the same height and weight. I just want to switch them.</p>

<p>Maybe my idea is not true, I may need different approach. I'm really inquisitorial about your suggestions. Any help would be great.</p>
