I got the debugger attached and in the debugger I
see the exception "RuntimeException, Your content must have a TabHost
whose id attribute is 'android.R.id.tabhost'

I have set the id of my tabhost element to tabhost.  I've also set it
in pretty much every other control.  I've looked at a number of
"samples" nothing is standing out as to what I did wrong.  Im at a
loss.

<?xml version="1.0" encoding="utf-8"?>
<TabHost
  xmlns:android="http://schemas.android.com/apk/res/android";
  android:id="@+id/tabhost"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <LinearLayout
    android:id="@+id/tabLinearLayoutID"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
        >
        <TabWidget
           android:id="@+id/tabs"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
          />
         <FrameLayout
           android:id="@+id/tabFrameID"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent"
           >
           <TextView
                   android:id="@+id/textView1Id"
                   android:layout_width="fill_parent"
                   android:layout_height="fill_parent"
                   android:text="tab 1"
               />
           <TextView
                   android:id="@+id/textView2Id"
                   android:layout_width="fill_parent"
                   android:layout_height="fill_parent"
                   android:text="tab 2"
               />
           <TextView
                   android:id="@+id/textView3Id"
                   android:layout_width="fill_parent"
                   android:layout_height="fill_parent"
                   android:text="tab 3"
               />
         </FrameLayout>
  </LinearLayout>
</TabHost>


On Oct 28, 8:22 am, tatman <[email protected]> wrote:
> I'm trying to figure out how to use the TabHost.  I am following this
> example 
> here:http://developer.android.com/guide/tutorials/views/hello-tabwidget.html
>
> The TabWidget "control" is causing a null pointer exception.  If I
> take it out, then I do not have the exception.   From what I can
> "see", I've followed the example closely.   Has anyone else seen this?
> or have an idea what's the problem?
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout
>         xmlns:android="http://schemas.android.com/apk/res/android";
>         android:orientation="vertical"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent">
>         <TabHost
>                 xmlns:android="http://schemas.android.com/apk/res/android";
>                 android:id="@+id/tabHostId"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent">
>                 <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="@+id/tabWidgetId"
>                                 android:layout_width="fill_parent"
>                                 android:layout_height="wrap_content" />
>                         <FrameLayout
>                                 android:id="@+id/tabContentId"
>                                 android:layout_width="fill_parent"
>                                 android:layout_height="fill_parent" >
>                                 <TextView
>                                         android:id="@+id/tabView1Id"
>                                         android:layout_width="fill_parent"
>                                         android:layout_height="fill_parent" />
>                                 <TextView
>                                         android:id="@+id/tabView2Id"
>                                         android:layout_width="fill_parent"
>                                         android:layout_height="fill_parent" />
>                                 <TextView
>                                         android:id="@+id/tabView3Id"
>                                         android:layout_width="fill_parent"
>                                         android:layout_height="fill_parent" />
>                         </FrameLayout>
>                 </LinearLayout>
>         </TabHost>
> </LinearLayout>
>
> Thnx
> Matt
--~--~---------~--~----~------------~-------~--~----~
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