Please see the follow code fragment:
// Create an Intent to launch an Activity for the tab (to be reused)
intent = new Intent().setClass(this, HomeTabActivity.class);
// Initialize a TabSpec for each tab and add it to the TabHost
spec = tabHost.newTabSpec("home").setIndicator("Home",
res.getDrawable(R.drawable.ic_tab_home)).setContent(intent);
tabHost.addTab(spec);
Now when I click on an tab button, it shows corresponding activity, but then I click the button again, I want to also detect this click, even if the tab is actually the "current" or active tab, is there anyway to do this? I did not find any set listener method in spec
.
Well, I don't think there is anything that does that as part of the tab control. There are a couple of things you could try though.
call below method using setListener(TabWidgetActivity); call it just before creating tabs.