這個XML有什麼問題嗎?我沒有得到任何編譯時錯誤,但是無論何時我嘗試編輯它,Eclipse都會給我一個nullpointerexception。爲什麼?定義我自己的Android主題的問題
/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>
通常,當Eclipse彈出一條消息時,您可以將其拖出來而不是關閉它並讓它再次發生。或者,嘗試使用非Android編輯器或純文本編輯器在Eclipse中編輯XML文件。 – 2010-09-23 19:41:56
好的解決方案,那就是我所做的。你應該發表你的評論作爲答案,所以我可以檢查它:) – 2010-09-23 21:48:57