Reputation: 2069
I'm trying to set a tabhost selector, as i found an example demonstrating that i should create an xml file in drawable like this :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/hotel_selected"
android:state_selected="true" />
<item android:drawable="@drawable/hotel" />
</selector>
but when compiling, eclipse keep saying that it's an invalid start tag in this file.
please help me solve this.
many thanks.
Upvotes: 7
Views: 16268
Reputation: 328
i have came across the same error and than solved, i did mistake of adding the xml file under values folder so it was not able to recognise selector tag. i removed it from values folder and added inside the drawable folder and it worked without any error. this was in case of Xamarin.Android.
Upvotes: 2
Reputation: 11
You can right click on the directory you want to create the XML file, selecect Android xml file, and then edit that file. This solved my issue.
Upvotes: 1
Reputation: 2069
Found a solution, I created the xml file by using a simple text editor (notepad++) and saved it to /res/drawable
and compiled, result: it worked like a charm :)
Upvotes: 13
Reputation: 128428
Its seems that there is no any error.
There may be some problem. But you can do one thing, do Project -> Clean , it may resolve your issue.
Upvotes: -2