title: Back button functionality in android tabgroup activity
body: <p>I have to develop back button functionality in android application.</p>
  
  <p>I have 4 tabs in tabgroup activity.
  Here i have to create the 4th tab is Go Back.</p>
  
  <p>Here i have to 4th tab means the 4 th tab is go to my previous activity.</p>
  
  <p>These is my  tabgroupactivity code:</p>
  
  <pre><code>intent = new Intent().setClass(this, MainGroupActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
      // Initialize a TabSpec for each tab and add it to the TabHost
      spec = tabhost.newTabSpec("Home").setIndicator("Home", 
                      res.getDrawable(R.drawable.arrow_up_float))
                      .setContent(intent);
      tabhost.addTab(spec);
  
      intent = new Intent().setClass(this, CartGroupActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
      // Initialize a TabSpec for each tab and add it to the TabHost
      spec = tabhost
              .newTabSpec("Cart")
              .setIndicator("Cart",
                      res.getDrawable(R.drawable.arrow_down_float))// debttab moretab
                                                          // expensestab
              .setContent(intent);
      tabhost.addTab(spec);
  
      intent = new Intent().setClass(this, LoginGroupActivty.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      // Initialize a TabSpec for each tab and add it to the TabHost
      spec = tabhost.newTabSpec("Login").setIndicator("Login",
                     res.getDrawable(R.drawable.btn_default_small))
                     .setContent(intent);
      tabhost.addTab(spec);
      intent = new Intent().setClass(this, GoBackActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
      // Initialize a TabSpec for each tab and add it to the TabHost
      spec = tabhost
              .newTabSpec("Go Back")
              .setIndicator("Go Back",
                      res.getDrawable(R.drawable.arrow_down_float))// debttab moretab
                                                          // expensestab
              .setContent(intent);
      tabhost.addTab(spec);
  </code></pre>
  
  <p><strong>Here the MainGroupActivity have 2 child class...i mean the main group activity have listview .i have to click any list means it is go to 1st child activity and have displayed listview with 4 tabs(tabgroup) in next screen.now i have to click any list in 1st child means it is go to 2nd childview and have displayed listview with 4tabs(tabgroup)..now i wish to click 4th tab(go back) in 2nd childview  means its  go to previous activity(1st child view)</strong>..how can i do ??? please help me...</p>
  
  <p>How can i write the condition for 4th tab.please give me code for these purpose.</p>