I want to have a tabbar with tabs. And I want just to catch tab pressing to update single view. I attempt to set setContent of TabHost to null but I've got error. How to implement this feature?
You cannot enter null to setContent in TabHost. One thing you can do is, create a dummy class and set that intent inside setContent()
method for the particular tab that you just want to update view as you say and you can update your view by setting on click listener to that child in your tab activity as below
getTabWidget().getChildAt(3).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//Update your view here
});
}
here you can pass the tab number inside getChildAt()
function, e.g. I have set it on 4th tab, being child number 3, as it starts count from 0.