I am trying to find way to be able to fire an onclick event on a tab when this tab is the current tab.
I did try this way (among several other) with no success thou
Ugly fix:IN the onClickListener put :
tabHost.SetCurrentTab(OtherTab);
tabHost.SetCurrentTab(CurrentTab);
Where for index of Other Tab I use my simplest view under the tabs.
P.S. Customers always want their apps to be different :)
This is the code that I use (I have only 2 tabs Tab1 and Tab2):
getTabWidget().getChildAt(1).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG,"1"+getTabHost().getCurrentTabTag());
if (getTabHost().getCurrentTabTag().equals("Tab2")) {
Log.d(TAG,"2");
tabHost.setCurrentTab(0);
tabHost.setCurrentTab(1);
} else {
tabHost.setCurrentTab(1);
}
}
});