Drawable mDrawable = context.getResources().getDrawable(R.drawable.face_icon); //Make this drawable mutable. //A mutable drawable is guaranteed to not share its state with any other drawable. mDrawable.mutate(); ColorMatrix cm = new ColorMatrix(); cm.setSaturation(0); ColorMatrixColorFilter cf = new ColorMatrixColorFilter(cm); mDrawable.setColorFilter(cf);
转自:http://gundumw100.iteye.com/blog/1126129