Theme preview fails in Eclipse

usr-local-ΕΨΗΕΛΩΝ picture usr-local-ΕΨΗΕΛΩΝ · Apr 24, 2012 · Viewed 35.4k times · Source

I have made a simple username/password dialog to which I want to apply a theme (it basically defines windowBackground) and would also like to preview in Eclipse.

I see that my theme is displayed along other themes in the Theme combo box, but selecting it produces the following error:

Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.

Failed to find style 'textViewStyle' in current theme
android.content.res.Resources$NotFoundException
Couldn't find theme resource attr/textAppearanceLarge for the current theme
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)

Theme definition:

<style name="my_theme">
    <item name="android:windowBackground">@drawable/form_header</item>
    <!-- <item name="android:padding">0dp</item>-->
    <item name="android:windowNoTitle">true</item>
</style>

Debugging works fine. However WYSIWYG would be more appreciable.

Answer

Sibevin Wang picture Sibevin Wang · Apr 24, 2012

Close your layout files in the editor first and restart your Eclipse.