Add view to XML layout programmatically and make its z order below an existing view
<p>I have an XML layout with some custom tabs, a heading, and a <code>ProgressBar</code>(<code>main.xml</code>).  I wish to add another XML layout(<code>home.xml</code>) to the <code>main.xml</code> layout, as i wish to keep <code>main.xml</code> re-usable for other activity's layouts and simply add things to it as necessary. </p>

<p><code>home.xml</code> contains a <code>ScrollView</code> and a <code>TextView</code>.  I am currently using my Activity's <code>LayoutInflator</code> to add <code>home.xml</code> to <code>main.xml</code>:</p>

<pre><code>LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.home, rootLayout);
</code></pre>

<p><code>rootLayout</code> is the root layout of <code>main.xml</code> and is a <code>RelativeLayout</code></p>

<p>The problem: after inflating <code>R.layout.home</code> into <code>rootLayout</code>, it seems as though the <code>ProgressBar</code> contained in <code>rootLayout</code> is hidden underneath the content of <code>home.xml</code></p>

<p>Is there a way to tell certain views(via XML) to float above other views when the layout is constructed in this way?</p>

<p>if not, am i forced to use methods such as <code>progressBar.bringToFront()</code> to raise targeted views to the top?</p>

<p>what alternatives do i have in z-ordering views when some layouts are constructed using inflation?</p>

<p>edit: it seems as though the <code>bringToFront()</code> method is not doing what i expect - i call it on one of my <code>Button</code> views and it still appears to be ordered below all other views(which were inflated) and remains unclickable</p>
