As armaan Stranger pointed out, tabs are outdated and you should use actionbar tabs. There is a good sample on how to create swipe tabs on android.developer.
If you still want to use the deprecated (you should not) then you need to implement OnTabChangeListener
then you can see which tab is called in public void onTabChanged(String tabId)
.