Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not entirely sure where your problem is, but this is how I've set up my Tabbed activities before</p> <p>layout.xml</p> <p></p> <p></p> <pre><code>&lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:id="@+id/tab1" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@android:id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/tab2" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@android:id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/tab3" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@android:id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; </code></pre> <p> </p> <p>Tab.java</p> <pre><code>public class InitialActivity extends TabActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout); TabHost th = getTabHost(); th.addTab(th.newTabSpec("tab_1").setIndicator("Tab1").setContent(R.id.tab1)); th.addTab(th.newTabSpec("tab_2").setIndicator("Tab2").setContent(R.id.tab2)); th.addTab(th.newTabSpec("tab_3").setIndicator("Tab3").setContent(R.id.tab3)); } } </code></pre> <p>Then, you can just use findViewById() on any views within the tabs, or if there are shared names between them, you can do <code>findViewById(R.id.tab1).findViewById(R.id.text)</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload