xml background don't change when i use tablet xml background don't change when i use tablet xml xml

xml background don't change when i use tablet


I've had the same problem but I've managed to solve this:the actual problem lies in a defect in android 3.2 regarding hardware acceleration so if you put in your AndroidManifest that your application is hardwareAccelerated="true" your problem will be solved.


I would suggest you to adjust your layout on each layout folder

and call your xml on each layout. It could be that when it was clicked in tablet, it was not displayed properly, I once experienced that issue too because the dimension or the resolution did not match, so the color is not displaying properly as well.


try getting rid of the

<item android:state_focused="true" android:drawable="@color/selector_focused" />

could just be the way that version of OS intercepts pressed and focused. just a guess tho, didn't really test it.

Try changing your .xml to:

<selector xmlns:android="http://schemas.android.com/apk/res/android">    <item android:state_pressed="true" >        <shape>                     <solid                android:color="#11223344" />        </shape>    </item>    <item>        <shape>           <solid               android:color="#AABBCCDD" />        </shape>    </item></selector>

of coures you can set your color to anything you'd like. That is if you are using static colors. you could add gradients and rounded edges and a border to this too.