Wednesday, 7 August 2013

Android XML closing tag

Android XML closing tag

I am learning to develop Android applications using Eclipse. My
application is for Android 3.0 and higher only. I am using the Google
tutorials, found here and have stumbled a little on the tutorial which
helps us style the action bar.
if you follow the above link, you will see that Google suggests we style
the action bar by creating an xml file called "/res/values/themes.xml and
coding it like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/actionbar_background</item>
<style>
</resources>
I immediately noticed the lack of closing </style> tags. And so did
Eclipse (this won't compile) Can anyone tell me why the <style> tags are
not closed?
I tried simply closing the tags myself, which seemed to fix the trouble,
though 2 other errors appeared: Error retrieving parent for item: No
resource found that matches the given name
'@style/Widget.Holo.Light.ActionBar.Solid.Inverse'. and
error: Error retrieving parent for item: No resource found that matches
the given name '@style/Theme.Holo.Light.DarkActionBar'.
How do I include the appropriate resources to clear these errors?

No comments:

Post a Comment