<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabHost" 
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="fill_parent"
android:layout_height="fill_parent"       
>                         
<TabWidget
  android:id="@android:id/tabs"
  android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
</TabWidget>
    <FrameLayout
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
    >
       <LinearLayout
       android:id="@+id/localLayout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
       >
       </LinearLayout>
     <LinearLayout
       android:id="@+id/sceneryLayout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
       >
       </LinearLayout>
    </FrameLayout>
</LinearLayout>
</TabHost> tabhost.addTab(tabhost.newTabSpec("0").setIndicator("地区").setContent(R.id.channelLayout)
);
                                                                           
tabhost.addTab(tabhost.newTabSpec("1").setContent(R.id.programeLayout)
.setIndicator("风景")); tabhost.setCurrentTab(0);
tabhost.setOnTabChangedListener(new OnTabChangeListener() {
                                                                                                             
public void onTabChanged(String tabId) {
if (tabId.equals("0")) {
Intent intent = new Intent(CollectActivity.this,
CollectLActivity.class);
   startActivity(intent); }
if (tabId.equals("1")) { 
Intent intent = new Intent(CollectActivity.this,
CollectSActivity.class);
startActivity(intent);
}
}
});
刚开始显示的是地区,点地区选项时,显示地区,点风景选项的显示风景,刚开始没点怎么显示地区啊

解决方案 »

  1.   

    你的是点击选项后实现跳转 ,在其它Activity中显示的地区,风景
    而不是在tab这个activity中显示地区 风景
    肯定不能显示啊!!
      

  2.   

    在tab这个activity中怎么显示啊?
      

  3.   

    怎么弄,点击不同的选项卡,还在一个activity中?
      

  4.   

    你的是点击选项后实现跳转 ,在其它Activity中显示的地区,风景
    而不是在tab这个activity中显示地区 风景
      

  5.   

    TabActivity的效果是,通过TabWidget的切换,来达到屏幕的切换效果!可以在同一个屏幕中,单击Tab显示不同的activity;
    http://blog.csdn.net/ch_984326013/article/details/6602602