Java tutorial
//package com.java2s; import android.graphics.drawable.Drawable; import android.graphics.drawable.StateListDrawable; public class Main { public static StateListDrawable crealeLableSelector(Drawable normalDrawable, Drawable pressedDrawable) { StateListDrawable selector = new StateListDrawable(); selector.addState(new int[] { android.R.attr.state_pressed }, pressedDrawable); selector.addState(new int[] {}, normalDrawable); return selector; } }