I use this:
actionBar.setBackgroundColor(ContextCompat.getColor(this, R.color.action_bar));
To use colors from the color.xml .
It works great, but in some Codes it says:
Wrong 1st argument type. Found: 'org.telegram.ui.ActionBar.BaseFragment', required: 'android.content.Context'
But I import android.content.Context:
import android.content.Context;
I tried to use instead of 'this':
actionBar.setBackgroundColor(ContextCompat.getColor(context, R.color.action_bar));
But than Android Studio say :
Cannot resolve symbol 'context'