I am getting an error from Eclipse when I use this xml file (res/
drawable/btnswitch.xml) to designate different button conditions
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/btn_st_rd" /> <!-- pressed -->
<item android:state_focused="true"
android:drawable="@drawable/btn_st_gr" /> <!-- focused -->
<item android:drawable="@drawable/btn_st_gr" /> <!-- default -->
</selector>
I call it in my layout file with this code:
<Button
android:id="@+id/startTimer_btn"
android:src="@drawable/btnswitch""
android:layout_width="wrap_content"
android:layout_height="fill_parent"
/>
Eclipse says it can't run the configuration because I have errors but
does not show any errors. And when I remove the xml code (to go back
to my original code which just sets a background image for the Button)
it says that now has errors. I have to restart Eclipse to get the
original code to run again.
Any ideas as to what I am missing?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.