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.os.Build;

public class Main {
    public static int getColour(Context context, int resId) {
        if (context == null)
            return 0;

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
            return context.getColor(resId);
        return context.getResources().getColor(resId);
    }
}