TabHost.TabSpec spec = tabs.newTabSpec("rycxtab");
spec.setContent(R.id.rycxtab);
spec.setIndicator("测试1",getResources().getDrawable(R.layout.infosearch_stress));
tabs.addTab(spec);
spec = tabs.newTabSpec("wpcxtab");
spec.setContent(R.id.wpcxtab);
spec.setIndicator("测试2",getResources().getDrawable(R.layout.infosearch_query_aticle));
tabs.addTab(spec);
spec = tabs.newTabSpec("ajcxtab"); spec.setContent(R.id.ajcxtab);
spec.setIndicator("测试3",getResources().getDrawable(R.layout.infosearch_law_case));
tabs.addTab(spec);
spec = tabs.newTabSpec("jgcxtab");
spec.setContent(R.id.jgcxtab);
spec.setIndicator("测试4",getResources().getDrawable(R.layout.infosearch_institution));
tabs.addTab(spec);
tabs.setCurrentTab(0);
spec.setContent(R.id.rycxtab);
spec.setIndicator("测试1",getResources().getDrawable(R.layout.infosearch_stress));
tabs.addTab(spec);
spec = tabs.newTabSpec("wpcxtab");
spec.setContent(R.id.wpcxtab);
spec.setIndicator("测试2",getResources().getDrawable(R.layout.infosearch_query_aticle));
tabs.addTab(spec);
spec = tabs.newTabSpec("ajcxtab"); spec.setContent(R.id.ajcxtab);
spec.setIndicator("测试3",getResources().getDrawable(R.layout.infosearch_law_case));
tabs.addTab(spec);
spec = tabs.newTabSpec("jgcxtab");
spec.setContent(R.id.jgcxtab);
spec.setIndicator("测试4",getResources().getDrawable(R.layout.infosearch_institution));
tabs.addTab(spec);
tabs.setCurrentTab(0);
应该是:getResources().getDrawable(R.id.infosearch_stress);几个选项卡都有问题哦!!
楼主看看吧!!