get Resource Color - Android App

Android examples for App:Resource

Description

get Resource Color

Demo Code


//package com.java2s;
import android.content.Context;

public class Main {

    public static int getResourceColor(Context con, int colorId) {
        if (con != null && colorId > 0) {
            return con.getResources().getColor(colorId);
        }//from w  ww. j  ava2  s .  c o  m
        return -1;
    }
}

Related Tutorials