Android examples for User Interface:View Background
set View BackGround Filter
//package com.java2s; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.view.View; public class Main { public static void setBackGroundFilter(View view, int color) { if (null != view) { setDrawableFilter(view.getBackground(), color); }/*from w w w. j av a 2 s .c om*/ } public static void setDrawableFilter(Drawable drawable, int color) { if (null != drawable) { drawable.setColorFilter(color, PorterDuff.Mode.MULTIPLY); } } }