Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import android.content.res.Resources; public class Main { @SuppressLint("NewApi") public static int getColorNew(Resources resources, int colorResourceId) { return resources.getColor(colorResourceId, null); } }