Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You mean you want to use TabView, i have given one sample here:</p> <pre><code>public class Welcome extends TabActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.welcome); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab intent = new Intent(Welcome.this, Select.class); spec = tabHost.newTabSpec("Show All").setIndicator("Show All",getResources().getDrawable(R.drawable.showall)).setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent(Welcome.this, Insert.class); spec = tabHost.newTabSpec("Insert").setIndicator("Insert",getResources().getDrawable(R.drawable.insertrelative)).setContent(intent); tabHost.addTab(spec); intent = new Intent(Welcome.this, Shownetwork.class); spec = tabHost.newTabSpec("Show Network").setIndicator("Show Network",getResources().getDrawable(R.drawable.showrelativeinfo)).setContent(intent); tabHost.addTab(spec); // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent(Welcome.this, Addnetwork.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("Add Network").setIndicator("Add Network",getResources().getDrawable(R.drawable.addrelativeinfo)).setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); </code></pre> <p>And this is Welcome.xml</p> <pre><code>&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"&gt; &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" android:padding="5dp" android:background="@drawable/images"/&gt; &lt;/LinearLayout&gt; </code></pre> <p></p>
 

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