一直出错,试了网上的方法都不行,就是一直返回null 日你个JAVA
tabHost=(TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();//最后发现要加上这句,大概意思就是初始化Tab吧
TabSpec tab1=tabHost.newTabSpec("Tab1").setIndicator("Tab 1", getResources().getDrawable(R.drawable.icon))
.setContent(R.id.textview1);
接着又出现一个错误
1. LinearLayout tempLayout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.table_tab, null);
2. TabHost.TabSpec tabItem = tabHost.newTabSpec("bb");
3. tabItem.setIndicator(tempLayout);
4.tabItem.setContent(R.id.table_gridView);
5.tabHost.addTab(tabItem);
先入为主以为又是 seContent,有parent
最后发现又变成setIndicator的问题,tempLayout不能有parent