Android examples for Graphics:Drawable Tint
set Drawable Tint
//package com.java2s; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Build; public class Main { public static void setTint(Drawable drawable, int color) { if (Build.VERSION.SDK_INT >= 21) { drawable.setTint(color);//from www . ja va 2s .c o m } else { drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP); } } }