Hi all,
I know that I can use a View as indicator for my tab (android 1.6 and
up), using public TabHost.TabSpec setIndicator (View view)
(http://developer.android.com/reference/android/widget/
TabHost.TabSpec.html#setIndicator(android.view.View))

I'd like tu put a TextView on it, but I get wrong with something!

I defined in a xml layout file a TextView element:

<TextView
                android:text="TabTitle"
                android:id="@+id/tabTextView"
                android:layout_width="wrap_content"
                android:layout_height="25px"></TextView>

The inside OnCreate method of my activity i try with the following:

--------------------- Activity OnCreate() code
---------------------------------
View myView = new View(this);

TabHost mTabHost = getTabHost();
mTabHost.addTab(mTabHost.newTabSpec("tab_test10").setIndicator(myview).setContent(R.id.tabtextview));
--------------------------------------------------------------------------------------------

Here the logcat error: E/AndroidRuntime(  572): Caused by:
java.lang.IllegalArgumentException: you must specify a way to create
the tab indicator.

Can someone help me? I can't understant where's the mistake. Have you
any example?
Thank you a lot,

 Marco

-- 
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

Reply via email to