Lucius Fox wrote: > Hi, > > In my layout xml, I have: > <TabHost android:id="@+id/tabhost" > 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"/> > > </TabHost> > > My question is how can I get a reference to TabWidget object. > > I tried this: > mTabWidget = (TabWidget) findViewById(com.android.internal.R.id.tabs); > > but this won't compile since 'com.android.internal.R is not visible. > > And then I try change the id to android:id="@+id/tabs" but I get a > run time error saying: > > "Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'"
Call getTabWidget() in your TabActivity. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

