views:

48

answers:

1

When I view the following xml file in the layout view (eclispse), I got NullPointerException:null message, but when I run the code, it works, can anyone explain this to me why?

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <LinearLayout 
                    android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:padding="5dp">
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp"/>
        </LinearLayout>     
</TabHost>
A: 

The problem is just that the Eclipse Layout view does not support TabHost controls yet.

ciczan
I did not know that, thank for the answer.
100KG
So,if you mind, vote my answer as appropriate.
ciczan