1
<?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_focused="true" android:drawable="@drawable/layout_bg1" /> <!-- focused -->
  <item android:state_pressed="true" android:drawable="@drawable/layout_bg1" /> <!-- pressed -->
  <item android:drawable="@drawable/layout_bg" /> <!-- default -->
</selector> 

I am trying to use custom drawables in my list selector.Here is the error message I am getting in the first line:

The processing instruction target matching "[xX][mM][lL]" is not allowed.

Ashish Kakkad
  • 23,586
  • 12
  • 103
  • 136
  • 2
    Possible duplicate of [XSL:The processing instruction target matching "\[xX\]\[mM\]\[lL\]" is not allowed](http://stackoverflow.com/questions/19889132/xslthe-processing-instruction-target-matching-xxmmll-is-not-allowed) – adneal Apr 20 '14 at 02:25

2 Answers2

1
<?xml version="1.0" encoding="utf-8"?>

just add the above line at your xml or check if its duplicate there

Abdurahman Popal
  • 2,859
  • 24
  • 18
0

You try this codes dependable your need . such as

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

    <item android:drawable="@color/footer_color" android:state_pressed="true"/>
    <item android:drawable="@color/footer_color" android:state_selected="true"/>
    <item android:drawable="@android:color/transparent"/>
    <item android:drawable="@drawable/back_black" android:state_pressed="true"/>
     <item android:drawable="@layout/full_image_screen" android:state_pressed="true"/>

</selector> 

Must be remember that when you access @drawable then must be include drawable image also for layout.

  • thanks for the answer but apparently there was some bug with eclipse,my code also worked after restarting and cleaning the project – abhishek kumar Apr 22 '14 at 15:46
  • Dear, if you help from my answer , then accept symbol click to earn 10 reputation, please –  Apr 23 '14 at 04:25