I am developing an application in Android 2.1 which requires loading of views dyamically based on button click. Here is the rough layout of my Activity.

Say on Clicking button1, it should display imageview, and on clicking button2, it should show listview, for button3 – linearlayout of button and images, and so on. All the views should be loaded in the provided white space only.
The approach I thought to follow is “Inflating layouts”.But on clicking another button, old inflated layout should be removed and new inflated layout should be visible.
Are there any better ways to achieve this?? If Inflating layouts is the only better way, how can I remove old inflated layout and load new inflated layout.
You can use a ViewFlipper to hold the three layouts and simply call
showNext()orsetDisplayedChild()to determine which layout is shown.