Android: Using linear gradient as background looks banded Android: Using linear gradient as background looks banded android android

Android: Using linear gradient as background looks banded


As Romain Guy suggests:

listView.getBackground().setDither(true);

solves my problem

If this is not enough especially for AMOLED and/or hdpi devices try this:

@Overridepublic void onAttachedToWindow() {    super.onAttachedToWindow();    Window window = getWindow();    window.setFormat(PixelFormat.RGBA_8888);}


You can simply enable dithering on your Drawable object.


Put this in your Activity:

@Overridepublic void onAttachedToWindow() {    super.onAttachedToWindow();    Window window = getWindow();    window.setFormat(PixelFormat.RGBA_8888);}