Java tutorial
//package com.java2s; //License from project: Apache License import android.annotation.TargetApi; import android.content.res.ColorStateList; import android.os.Build; import android.util.StateSet; public class Main { @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static ColorStateList createActivatedColor(int passive, int active) { return new ColorStateList(new int[][] { new int[] { android.R.attr.state_activated }, StateSet.WILD_CARD }, new int[] { active, passive }); } }