mTh = getTabHost();
mTh.addTab(mTh.newTabSpec("tab1").setIndicator(TAG_WRITE, getResources()
.getDrawable(R.drawable.writemessage))
.setContent(tab1_intent));我利用的Intent跳转 可以实现
mTh.addTab(mTh.newTabSpec("tab1").setIndicator(TAG_WRITE, getResources()
.getDrawable(R.drawable.writemessage))
.setContent(tab1_intent));我利用的Intent跳转 可以实现
Intent tab1_intent = new Intent();
tab1_intent.setClass(main.this, Tab1.class);
Intent tab2_intent = new Intent();
tab2_intent.setClass(main.this, Tab2.class);
mTh = getTabHost();
mTh.addTab(mTh.newTabSpec("tab1").setIndicator(TAG1, getResources()
.getDrawable(R.drawable.tab1))
.setContent(tab1_intent));
mTh.addTab(mTh.newTabSpec("tab2").setIndicator(TAG2, getResources()
.getDrawable(R.drawable.tab2))
.setContent(tab2_intent));
}
还有 你说出错,能不能把log发出来看看,有那就好分析多了!