Android-第一个选项卡最初未加载
我动态添加了选项卡。通常,我的第一个标签页只有在从其他标签页来回后才被加载。你能给我一个解决这个问题的办法吗 //------动态添加选项卡Android-第一个选项卡最初未加载,android,tabs,Android,Tabs,我动态添加了选项卡。通常,我的第一个标签页只有在从其他标签页来回后才被加载。你能给我一个解决这个问题的办法吗 //------动态添加选项卡 for (int i=0; i<tabs.length; i++){ String tabName = tabs[i]; specs = th.newTabSpec(tabName); specs.setContent(R.id.llItemList); list1=(ListV
for (int i=0; i<tabs.length; i++){
String tabName = tabs[i];
specs = th.newTabSpec(tabName);
specs.setContent(R.id.llItemList);
list1=(ListView)findViewById(R.id.lvCommonList);
adapter=new Adapter(this, item[i]);
list1.setAdapter(adapter);
specs.setIndicator(tabName);
th.addTab(specs);
}
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
currentTab = tabId;
for (int i=0; i<tabs.length; i++){
if (currentTab.equals(tabs[i])){
linearLayout.removeView(list1);
linearLayout.addView(list1);
adapter=new Adapter(this, item[i]);
list1.setAdapter(adapter);
}
}
}