I want to change the layout of my <include/> tag dynamically/programmatically.
I have a main layout that I want to re-use but the contents should change dynamically.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white_background"
android:orientation="vertical" >
<include
android:id="@+id/main_container"
layout="REPLACE_THIS" />
</android.support.v4.widget.SwipeRefreshLayout>
Above is the xml that I am using, I am assuming that you will need to find the id of the include and then change it programmatically.
Thanks in advance.