Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要的是当我点击一个标签时我需要运行一些代码,无论如何我可以做到这一点吗?
尝试这个:
getTabHost().setOnTabChangedListener(new OnTabChangeListener() { @Override public void onTabChanged(String tabId) { //YOUR CODE } }
为此,我总是使用 TabHost.OnTabChangeListener。