Android examples for Graphics:Text Color
get Text Color Primary
//package com.java2s; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; public class Main { public static final int TEXT_COLOR_PRIMARY = android.R.attr.textColorPrimary; public static ColorStateList getTextColorPrimary(Context context) { return getSystemAttrColor(context, TEXT_COLOR_PRIMARY); }//www . j a va 2s .co m public static ColorStateList getSystemAttrColor(Context context, int attr) { TypedArray a = context.obtainStyledAttributes(new int[] { attr }); ColorStateList color = a.getColorStateList(a.getIndex(0)); a.recycle(); return color; } }