I used Erel's suggestion above. When I load the 1st layout, it works fine. But when I try to load the 2nd layout, I get an error:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
I tried, adding Activity.RemoveView right after the Activity.RemoveViewAt(0) in the If condition, however, it still gives the same error.