How to hide a View programmatically?
<p>In my application, I have 2 <code>LinearLayout</code>'s right above each other. Via a menu option, I want to be able to make the bottom one disappear, and have the top one drop down over the disappeared <code>LinearLayout</code>...</p>

<p>The problem is, I have no idea on how to do this in Java.</p>

<p>It doesn't have to be animated, I want to hide the <code>Layout</code> on return of another activity (the menu), in <code>OnActivityResult</code>. The menu <code>activity</code> sets a <code>boolean</code> on which I check in <code>OnActivityResult</code>, and according to it's value I determine if I need to hide or show the bottom <code>Layout</code>:</p>

<pre><code>// Only change value if it is different from what it was.
if(mUseVolumeButtonAsPTT != resultData.getBoolean("UseVolumeButtonAsPTT")){
    mUseVolumeButtonAsPTT = resultData.getBoolean("UseVolumeButtonAsPTT");
    if(!mUseVolumeButtonAsPTT){
        // Hide lower LinearLayout.
    } else {
        // Show lower LinearLayout.
    }
}
</code></pre>

<p>Could anybody give me a hint or a link on how I should do this? Thanks in advance...</p>
