Hi, I believe the problem is in the parent of the style. You shouldn't put the '@':
<style name="mystyle" parent="android:TextAppearance"> <item name="android:textSize">12dip</item> <item name="android:textColor">#000000</item> </style> Rúben On Dec 15, 6:16 pm, Mark Wyszomierski <[email protected]> wrote: > Hi, > > I've got a text style defined in styles.xml. I'm trying to reference > it from a layout. When I reference from the layout, it causes an > exception upon inflation. If I use the style from java code, it works > fine. Setting the individual styles on the TextView works fine too: > > <TextView > android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:text="Test" > android:textStyle="@style/mystyle" > /> > > <style name="mystyle" parent="@android:style/TextAppearance"> > <item name="android:textSize">12dip</item> > <item name="android:textColor">#000000</item> > </style> > > so if I just directly set textSize and textColor on the TextView with > the same values, it works fine. Looks like the exception comes down > to: > > "ERROR/AndroidRuntime(1109): Caused by: > java.lang.NumberFormatException: unable to parse '@2131165194' as > integer" > > must be doing something wrong here? If I comment out the style set, > the layout inflates fine. Also looks fine in the resource editor. It's > just when running it causes a problem, > > Thanks -- 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

