I’ve main_layout.xml as a root layout, does not matter it’s RelativeLayout or LinearLayout. And that root layout has different layouts in its own. Basicly it’s looking like this:
<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" >
<RelativeLayout
android:id="@+id/panel_bar">
<!-- -->
</RelativeLayout>
<RelativeLayout
android:id="@+id/other_bar">
</RelativeLayout>
<RelativeLayout
android:id="@+id/main_bar">
<Button id="@+id/change_button" />
</RelativeLayout>
</RelativeLayout>
When I’ve clicked to change_button I want to change panel_bar with another layout, let’s say another_layout. By the way, another_layout is an existing layout in a differet file. They are both (panel_bar and another_layout) the same height and weight. I just want to switch them.
Maybe my idea is not true, I may need different approach. I’m really inquisitorial about your suggestions. Any help would be great.
Easiest way is just put both layouts in root layout and set
visibleof one togonethen switch visibility as you need.