title: How can I add horizontal swipe to a TabActivity?
body: <p>I have seen some similar posts here, but I haven't found any answers. I want to add a swipe gesture to my tab activity, so that I'm able to change tabs with the gesture. </p>
  
  <p>Here's my code: </p>
  
  <pre><code>public class Domiciliaria extends TabActivity 
  {
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          //requestWindowFeature(Window.FEATURE_NO_TITLE);
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_seleccion);
  
          //ActionBar bar = getActionBar();
          //bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#cd3b05")));
  
          final TabHost tabHost = getTabHost();
          tabHost.setOnTabChangedListener(new OnTabChangeListener() {
                  @Override
                  public void onTabChanged(String tabId) {
                      // TODO Auto-generated method stub
                      setTabColor(tabHost);
                  }
              }
          );
  
          // Tab for primera
          TabSpec primeraspec = tabHost.newTabSpec("info 1");
          primeraspec.setIndicator("Datos", getResources().getDrawable(R.drawable.primera));
          Intent primeraIntent = new Intent(this, Parte_primera.class);
          primeraspec.setContent(primeraIntent);
  
          // Tab for segunda
          TabSpec segundaspec = tabHost.newTabSpec("info 2");        
          segundaspec.setIndicator("Motivos", getResources().getDrawable(R.drawable.segunda));
          Intent segundaIntent = new Intent(this, Parte_segunda.class);
          segundaspec.setContent(segundaIntent);
  
          // Tab for tercero
          TabSpec tercerospec = tabHost.newTabSpec("info 3");        
          tercerospec.setIndicator("Examen", getResources().getDrawable(R.drawable.tercera));
          Intent terceroIntent = new Intent(this, Parte_tercera.class);
          tercerospec.setContent(terceroIntent);
  
          // Tab for Cuarto
          TabSpec cuartospec = tabHost.newTabSpec("info 4");        
          cuartospec.setIndicator("otro", getResources().getDrawable(R.drawable.cuarta));
          Intent cuartoIntent = new Intent(this, Parte_cuarta.class);
          cuartospec.setContent(cuartoIntent);
  
          // Tab for Final
          TabSpec finalspec = tabHost.newTabSpec("info 4");        
          finalspec.setIndicator("Final", getResources().getDrawable(R.drawable.pago));
          Intent finalIntent = new Intent(this, Final.class);
          finalspec.setContent(finalIntent);
  
          // agregando TabSpec to TabHost
          tabHost.addTab(primeraspec); // Adding photos tab
          tabHost.addTab(segundaspec); // Adding songs tab
          tabHost.addTab(tercerospec);
          tabHost.addTab(cuartospec);
          tabHost.addTab(finalspec);
          tabHost.getTabWidget().setStripEnabled(true);
          tabHost.getTabWidget().setRightStripDrawable(R.drawable.barra_mamei);
          tabHost.getTabWidget().setLeftStripDrawable(R.drawable.barra_mamei);
          setTabColor(tabHost);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu, menu);
          return true;
      }
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              case R.id.about:
              startActivity(new Intent(this, About.class));
              return true;
              case R.id.help:
              startActivity(new Intent(this, Help.class));
              return true;
              case R.id.CasoEspecial:
              startActivity(new Intent(this, CasoEspecial.class));
              return true;
              default:
              return super.onOptionsItemSelected(item);
          }
          // respond to menu item selection
      }
  
      protected void setTabColor(TabHost tabHost) {
          // TODO Auto-generated method stub
          for(int i=0;i&lt;tabHost.getTabWidget().getChildCount();i++) {
              tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#E04006")); //unselected
          }
          tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#fbfbf3")); // selected
      }
  }
  </code></pre>