I\'ve been trying to get android to dither the background image of an activity - so far without success. I have no clue what\'s wrong.
This is what I did:
Th
I had this issues too, I fixed applying nine-patch feature to background image.
Hope this help
A lot of folks having the same problem report that setting setDither(true) on your drawable resource in the Java code works when the XML attribute does not. In this case, if you can get a reference to your LinearLayout in the onCreate method, try
linearLayout.getBackground().setDither(true).
An alternative would be to try setting a different pixel format as described here:
http://stuffthathappens.com/blog/2010/06/04/android-color-banding/
Good luck!
On Android 2.2.1 and below there is a bug which causes dithering to be disabled if filtering is enabled. On Android 2.3.3 and 3.0 this issue seems to be fixed. I'm not sure if the same might be true for antialias as you have enabled.
Try to put this line
getWindow().setFormat(PixelFormat.RGBA_8888);
just after super.onCreate()
and see if it helps.
Ran into this problem too today and found and used your solution : Create the png in photoshop with transparency set AND having at least one pixel using the alpha. Actually what i did is set the layer to a 99% opacity. Doesn't affect the colors or anything and make the Android compiler leave my png alone.