>Tough to tell without seeing your code. If you're not using TabActivity,
>be sure to call setup() on your TabHost after you get it via
>findViewById(). If you are using TabActivity, be sure to ask it for your
>TabHost.
trying again for declarative tabs here --
<!-- contacts_view.xml -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contacts_view"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@drawable/masthead_logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SHITE"
/>
</FrameLayout>
</TabWidget>
</TabHost>
</LinearLayout>
// ContactsActivity.java (extends TabActivity)
@Override
public void
onCreate (Bundle inSavedInstanceState)
{
super.onCreate (inSavedInstanceState);
setContentView (R.layout.contacts_view);
}
...and the error trace
Uncaught handler: thread main exiting due to uncaught exception
java.lang.NullPointerException
at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:285)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:640)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:640)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:640)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:640)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1645)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3948)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method)
in TabHost.java, mCurrentView is null.
any help appreciated, i'd really like to keep all this stuff declarative.
thanks
--
jason.vp.engineering.particle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---