请问如何在不添加 Intent 的情况下刷新选项卡 2(标签 2,实时博客)的内容。
TabHost th = (TabHost)findViewById(R.id.tabhost1); th.setup();
TabHost.TabSpec spec = th.newTabSpec("tag1")
.setIndicator("Testimonies", getResources()
.getDrawable(R.drawable.icon_testimonies_tab))
.setContent(R.id.tab1);
th.addTab(spec);
spec = th.newTabSpec("tag2")
.setIndicator("Live Blog", getResources()
.getDrawable(R.drawable.icon_liveblog_tab))
.setContent(R.id.tab2);
th.addTab(spec);
spec = th.newTabSpec("tag3")
.setIndicator("Streaming Settings", getResources()
.getDrawable(R.drawable.icon_streamingsetting_tab))
.setContent(R.id.tab3);
th.addTab(spec);
th.setCurrentTab(1);
th.getCurrentView().setVisibility(View.VISIBLE);
最佳答案
我们又“见面”了,@meduniopeyemi!我努力工作试图解决你正在谈论的问题。我以前的做法是:
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
public void onTabChanged(String tabId) {
//YOUR CODE checking if "tabId" is the tab you want to REFRESH
}
});
到目前为止它对我有用。它只允许您毫无问题地进行任何刷新。
关于android - 无意刷新 Android 标签页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12974542/