Get widgets from other layouts
<p>How do I access widgets in the java-code from a layout of another Activity? I have a TabActivity which uses two tabs each with it's own Activity class calling setContentView on it's own layout. The TabActivity do this also. </p>

<p>I want to be able to use findViewById(R.id.id_from_view_inside_tab_activity) in the TabActivity class.</p>

<p>For example. I have the TabActivity Foo and another Activity called Bar. Foo have a layout called foo.xml and Bar have bar.xml. In bar.xml I declare </p>

<pre><code>    &lt;EditText
        android:id="@+id/entry1"
        android:background="@android:drawable/editbox_background"&gt;
</code></pre>

<p>What do I need to do in Foo to be able to call findViewById(R.id.entry1) ? (Or something similiar).</p>
