Ah yeah, it's a known issue: the TabHost (or more exactly TabWidget)
generates an internal NullPointerException when used in the layout
editor. It should render fine on the emulator or a device though.

Hopefully this should be fixed in the next version of android, whenever that is.

R/

On Thu, May 14, 2009 at 2:38 AM, Michaël Gerber <[email protected]> wrote:
> Hi,
> I have done a XML file but I can't see it in the the Eclipse Layout, there
> is an error : "NullPointerException: null"...
>
> Here is the XML file :
>
> <?xml version="1.0" encoding="utf-8"?>
> <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:id="@+id/layoutTop"
>         android:orientation="vertical"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         <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">
>             <TextView
>                 android:id="@+id/general"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent"
>                 android:text="general option : work in progress" />
>             <LinearLayout
>                 android:id="@+id/xtraZone"
>                 android:orientation="vertical"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent">
>                 <TextView
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:text="Phone number :"/>
>                   <EditText
>                     android:id="@+id/txtUsername"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:gravity="top"
>                     android:phoneNumber="true"/>
>                   <TextView
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:text="Password :"/>
>                   <EditText
>                     android:id="@+id/txtPassword"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:gravity="top"
>                     android:password="true"/>
>                </LinearLayout>
>             <LinearLayout
>                 android:id="@+id/about"
>                 android:orientation="vertical"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent">
>                 <TextView
>                     android:id="@+id/appName"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:text="MonkeySMS"/>
>                 <TextView
>                     android:id="@+id/year"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:text="2009"/>
>                 <TextView
>                     android:id="@+id/visit"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>                     android:text="Visit :"/>
>                 <TextView
>                     android:id="@+id/link"
>                     android:layout_width="fill_parent"
>                     android:layout_height="wrap_content"
>
> android:text="http://subversion.assembla.com/svn/MonkeySMS";
>                     android:autoLink="web"/>
>              </LinearLayout>
>         </FrameLayout>
>     </LinearLayout>
>     <LinearLayout
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:layout_gravity="bottom"
>         android:orientation="horizontal">
>         <Button
>             android:id="@+id/save"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:text="Save"/>
>          <Button
>             android:id="@+id/close"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:text="Close"/>
>       </LinearLayout>
> </TabHost>
>
> I don't know if the error comes from the XML code or from eclipse, because I
> can see the other XML in the Layout...
> Thank you for your help
> Michaël
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to