• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Custom xml buttons help

i wrote this xml file

Code:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
    
    <item android:drawable="@drawable/bdrumoff" ></item>

</selector>
called drumbutton (no capital letters if that matters)

then i tried to put it in my main.xml like this
Code:
    <Button
        android:id="@+id/drumbutton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/drumbutton" />

which resulted in this error
Code:
Failed to parse file C:\eclipse\WorkSpace\DubstepMixer\res\drawable\drumbutton.xml
Exception details are logged in Window > Show View > Error Log

The error log states the following
Code:
Message:
main.xml: Failed to parse file C:\eclipse\WorkSpace\DubstepMixer\res\drawable\drumbutton.xml

what did i do wrong ?

thanks in advance :)
 
is
bdrumoff a bitmap?


you might want something like this instead:
Code:
<?xml version="1.0" encoding="utf-8"?>
 
<selector xmlns:android="http://schemas.android.com/apk/res/android">
 <item>
     <bitmap android:src="@drawable/"bdrumoff />
  </item>
</selector>
 
Back
Top Bottom