Java tutorial
//package com.java2s; import android.content.res.ColorStateList; public class Main { /** * helper to create a colorStateList for the text * * @param text_color * @param selected_text_color * @return */ public static ColorStateList getTextColorStateList(int text_color, int selected_text_color) { return new ColorStateList(new int[][] { new int[] { android.R.attr.state_selected }, new int[] {} }, new int[] { selected_text_color, text_color }); } }