I have a tabview in my android app with 3 tabs. The tabs are all working fine.
Now I want to perform some additional logic when the tab (on the top) of the currently active tab is clicked.
Here is an example:
In one of my tabs, I provide an option for the user to sort things in different order. When the press the tab of the currently active tab, I want to reset all these sorting.
Is it possible to capture the tab click event in tabview and perform some additional logic?
Edit: Edited for clarity.
This is how your code should work :
getTabWidget().getChildAt(getTabHost().getCurrentTab()).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//do whatever you need
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With