[android] How to set tint for an image view programmatically in android?

For set tint for an image view programmatically in android

I have two methods for android :

1)

imgView.setColorFilter(context.getResources().getColor(R.color.blue));

2)

 DrawableCompat.setTint(imgView.getDrawable(),
                     ContextCompat.getColor(context, R.color.blue));

I hope I helped anyone out :-)