In the new AppCompat library, we can tint the button this way:
According to the documentation the related method to android:backgroundTint
is setBackgroundTintList(ColorStateList list)
Update
Follow this link to know how create a Color State List Resource.
then load it using
setBackgroundTintList(contextInstance.getResources().getColorStateList(R.color.your_xml_name));
where contextInstance
is an instance of a Context
using AppCompart
btnTag.setSupportButtonTintList(ContextCompat.getColorStateList(Activity.this, R.color.colorPrimary));