I'm trying to create a custom TabHost
. And I want to call the setTabSelectionListener()
method of TabWidget
.
But I have the following error:
TabWidget.OnTabSelectionChanged cannot be resolved to a type
Here is my test code:
public class CustomTabHost {
public CustomTabHost(Activity activity) {
TabWidget tab_widget = (TabWidget) activity.findViewById(R.id.tab_widget);
tab_widget.setTabSelectionListener(new TabWidget.OnTabSelectionChanged() {
public void onTabSelectionChanged(int tabIndex, boolean clicked) {
}
});
}
}
I'm using Eclipse and Android 2.2.
Thanks in advance!