title: custom tabview in android
body: <p>I want to design a page in which i just want to show only one tab. But when i add only one tab, it takes the full width available but i want that tab only takes small space and remaining space is left empty. No other tabs i want to add. Only one tab is displayed all time. Code is following</p>
  
  <pre><code>public class TabViewActivity extends TabActivity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          TabHost tabHost = getTabHost();  // The activity TabHost
          TabHost.TabSpec spec;  // Resusable TabSpec for each tab
          Intent intent;  // Reusable Intent for each tab
  
          // Create an Intent to launch an Activity for the tab (to be reused)
          intent = new Intent().setClass(this, FirstTab.class);
          // Initialize a TabSpec for each tab and add it to the TabHost
  
          spec = tabHost.newTabSpec("firstTab").setIndicator("First Tab")
                        .setContent(intent);
  
  
          tabHost.addTab(spec);
          tabHost.setCurrentTab(1);
  </code></pre>