ContextCompat is a class for replacing some work with a basic context.
For example, if you used before something like
getContext().getColor(R.color.black);
Now its obsolete since android 6.0 (API 22+), so you should use:
getContext().getColor(R.color.black,theme);
or use ContextCompatthat automatically fills the topic, depending on the topic Context:
ContextCompat.getColor(getContext(),R.color.black)
Same thing with getDrawable
ContextCompat API 22+,