views:

32

answers:

2

Is there anything wrong with this XML? I don't get any compile time errors, but anytime I try to edit it, Eclipse gives me a nullpointerexception. Why?

/res/values/styles.xml

<?xml version="1.0" encoding="utf-8"?>
    <resources>
      <!-- Base application theme is the default theme. -->
      <style name="Theme" parent="android:Theme">
      </style>

      <!-- Variation on our application theme that has a translucent
     background. -->
      <style name="Theme.Translucent">
        <item name="android:windowBackground">@drawable/translucent_background</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:colorForeground">#fff</item>
      </style>

      <!-- Variation on our application theme that has a transparent
    background; this example completely removes the background,
    allowing the activity to decide how to composite. -->
      <style name="Theme.Transparent">
        <item name="android:windowBackground">@drawable/transparent_background</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:colorForeground">#fff</item>
      </style>
      <style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme">
        <item name="android:textStyle">normal</item>
      </style>

    </resources>
A: 

Nothing pops out at me right away, just make sure you have transparent_background and translucent_background in your res/drawable folder.

cfei
A: 

I have seen this a couple times as well. I did a Project->Clean and then restarted eclipse. When it came back up the problem went away.

Shaun