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.graphics.PorterDuff;
import android.graphics.drawable.Drawable;

public class Main {
    public static Drawable getTintedDrawable(int resDrawable, int tintColor, Context context) {
        Drawable d = context.getResources().getDrawable(resDrawable); // ToDo: use non-deprecated method
        d.setColorFilter(tintColor, PorterDuff.Mode.SRC_IN);
        return d;
    }
}