title: How to make a bottom tab bar in android?
body: <p>I am using this code to put bottom tab bar in android but it does not appear in my layout pages in the app. also I made the maintab.xml and other tab required files in the drawable. but still it does not work. Can you please tell me what is wrong ?</p>
  
  <pre><code>  public class TabbottonActivity extends TabActivity {
      /** Called when the activity is first created. */
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.maintab);
          setTabs() ;
      }
      private void setTabs()
      {
          addTab("Home", R.drawable.tab_home, MenuActivity.class);
          addTab("Search", R.drawable.tab_search, DestinationActivity.class);
  
          addTab("Home", R.drawable.tab_home, MenuActivity.class);
          addTab("Search", R.drawable.tab_search, DestinationActivity.class);
      }
  
      private void addTab(String labelId, int drawableId, Class&lt;?&gt; c)
      {
          TabHost tabHost = getTabHost();
          Intent intent = new Intent(this, c);
          TabHost.TabSpec spec = tabHost.newTabSpec("tab" + labelId);
  
          View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
          TextView title = (TextView) tabIndicator.findViewById(R.id.title);
          title.setText(labelId);
          ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
          icon.setImageResource(drawableId);
  
          spec.setIndicator(tabIndicator);
          spec.setContent(intent);
          tabHost.addTab(spec);
      }
  }
  </code></pre>