0

I'm seeing banding on my activities using the Holo theme on my Samsung Galaxy Nexus, Android version 4.0.2.

Below is a screenshot of my PreferenceActivity, taken from the Nexus using DDMS, which illustrates the issue.

I have tried adding (to no avail):

getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

What causes this and is there a work around?

PreferenceActivity

TZHX
  • 5,291
  • 15
  • 47
  • 56
timothyjc
  • 2,188
  • 3
  • 29
  • 54
  • Did you find any resolution for this? I'm experiencing banding issues when applying a gradient in various `View` classes, even though I'm already applying various known fixes (such as `PixelFormat.RGBA_8888`). It seems to be an issue that only occurs on my 4.0 and 4.1 devices. – Trevor Aug 16 '12 at 13:34
  • Does this occur on an actual device or just the emulator? For me the emulator does this however my devices do not. – xordon Dec 10 '12 at 08:10

2 Answers2

0

This worked for me:

@Override
    public void onAttachedToWindow() {

            getWindow().setFormat(PixelFormat.RGBA_8888);
}
radiofrequency
  • 873
  • 8
  • 19
0

Dither itself is an imperfect solution to the problem, check to see that:

  1. Make sure the Bitmap is loaded with the following settings BitmapFactory.Options.inPreferredConfig=Bitmap.Config.RGBA_8888 and BitmapFactory.Options.inDither=false

  2. The background image is not stretched

Reference

Kai
  • 15,284
  • 6
  • 51
  • 82