While looking at the answer here, I was having problems on the line:
TypedArray ta = obtainStyledAttributes(R.style.MyCustomStyle, attrs);
I think the correct way to suppress this :
I'm offered this when I press Alt-Enter to bring up fixes for the warning and choose Inspection 'Constant and Resource Type Mismatches' options > Suppress for class (screenshot attached).
It works for me.
It's possible that the ID for this inspection has changed since whatever code you were referencing was written; I looked briefly through the commit logs but couldn't find a reference to it.