sequentially including various View classes in a parent layout <p>I have a main layout in which I'd like to sequentially display / hide various custom layouts according to timers and user input.</p> <p>In my example, I'd like the following timeline:</p> <ol> <li><p>show an initial layout, created by the class MainStart. The user will click on the button when they're ready to start.</p></li> <li><p>after the user clicks, we'll run a countdown timer, displaying the countdown to the screen. This is done by MainCountdown.</p></li> <li><p>once the countdown is complete, MainLast is displayed. It has a button allowing the user to click "Again?" when they want to start over.</p></li> <li><p>if the user clicks "Again?" then go to step 1. </p></li> </ol> <p>According to <a href="http://stackoverflow.com/questions/5342121/inflate-a-view-layout-into-another-layout">this question</a>, I may have to use removeView() and addView() to achieve what I want.</p> <p>I pushed to GitHub a trimmed down version of what I want to do: <a href="https://github.com/thunderrabbit/Stack-Overflow-layout-inflation" rel="nofollow">Hide and Show Layouts</a> so you can see everything, but the problem seems to boil down to <code>myView</code> still being visible after this:</p> <pre><code>myView = inflate(mContext, R.layout.main_start, _view_group); myView.setVisibility(View.GONE); </code></pre> <p><a href="https://github.com/thunderrabbit/Stack-Overflow-layout-inflation/blob/master/src/com/stackoverflow/thunderrabbit/layout/inflation/MainStart.java#L33" rel="nofollow">direct link to code on GitHub</a></p> <p><a href="https://github.com/thunderrabbit/Stack-Overflow-layout-inflation/blob/master/res/layout/main_start.xml#L1" rel="nofollow">direct link to related layout</a></p> <p>Can I make a small change to my code/layouts to make the views hide/appear the way I want?</p> <p>Am I completely <em>Doing It Wrong</em>?</p>