Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}