title: How to add OnBackPressed in TabActivity?
body: <p>Can anyone tell me how to add listener of back button pressed method in <strong>TabActivity</strong> ?<br>
  This is my code. At where to add the backbutton pressed method?</p>
  
  <p><strong>HomeActivity.java</strong></p>
  
  <pre><code>public class HomeActivity extends TabActivity {
  public static TabHost tabHost;
  public static TabSpec hometab,extrastab,coursetab,logintab;
   @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.home_tab_layout);
  
          tabHost = getTabHost();
  
          hometab = tabHost.newTabSpec("Home");
          hometab.setIndicator("", getResources().getDrawable(R.drawable.home_tab));
          hometab.setContent(new Intent().setClass(this,HomeTabActivity.class));
  
          coursetab = tabHost.newTabSpec("Courses");        
          coursetab.setIndicator("", getResources().getDrawable(R.drawable.courses_tab));
          coursetab.setContent(new Intent(this,MainActivity.class));
  
          logintab = tabHost.newTabSpec("Login");
          logintab.setIndicator("", getResources().getDrawable(R.drawable.login_tab));
          logintab.setContent(new Intent(this,LoginTabActivity.class));
  
          extrastab = tabHost.newTabSpec("Extras");
          extrastab.setIndicator("", getResources().getDrawable(R.drawable.extras_tab));
          extrastab.setContent(new Intent(this,ExtrasTabActivity.class));
  
          tabHost.addTab(hometab); 
          tabHost.addTab(coursetab); 
          tabHost.addTab(logintab); 
          tabHost.addTab(extrastab);
  
          tabHost.setPadding(5, 5, 5, 5);
      }
  }
  </code></pre>