Java tutorial
//package com.java2s; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; public class Main { private static final int DEFAULT_COLOR = Color.BLACK; private static int[] typeArray = new int[] { android.R.attr.textColor }; private static int getTextColorFromStyle(Context ctx, int styleId) { TypedArray ta = ctx.obtainStyledAttributes(styleId, typeArray); int color = ta.getColor(0, DEFAULT_COLOR); ta.recycle(); return color; } }