title: how to detecting a click on an already selected tab button
body: <p>I am trying to get the Click event when clicking on currently selected tab of my
         TabActivity.</p>
  
  <p>I tried below code but when i click on one tab the other tabs are not working/clicking properly.  </p>
  
  <pre><code>    setupTab(new TextView(this), "Map");
      setupTab(new TextView(this), "Attacks");
      setupTab(new TextView(this), "Profile");
      setupTab(new TextView(this), "Headquater");
  
      int numberOfTabs = tabHost.getTabWidget().getChildCount();
      for(int t=0; t&lt;numberOfTabs; t++){
      getTabWidget().getChildAt(t).setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
  
                  if(tabHost.getCurrentTab() == 0){
                      Toast.makeText(TabContext, ""+"i m in on clickkkkk" ,1500).show();
                      getTabHost().setCurrentTab(0);
                  }
                  if(tabHost.getCurrentTab() == 1){
                      Toast.makeText(TabContext, ""+"i m in on clickkkkk....$#@$#$" ,1500).show();
                      getTabHost().setCurrentTab(1);
                  }
  
              }
          });
      }
  </code></pre>