PorterduffXfermode: Clear a section of a bitmap

The problem is hardware acceleration. Turn it OFF for the particular View that you are painting with CLEAR. If you’re using a custom view, do this in the constructors:

if (android.os.Build.VERSION.SDK_INT >= 11) 
{
     setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

You can also call setLayerType on a view reference.

Leave a Comment