getTheme().resolveAttribute() alternative on pre-lollipop
<p>I have been struggling to obtain the styled attributes with the pre-lollipop API.</p>

<p>With lollipop, I use  </p>

<pre><code>final TypedValue statusBarColor = new TypedValue();
getTheme().resolveAttribute(android.R.attr.colorPrimaryDark, statusBarColor, true);
STATUS_BAR_COLOR = ContextCompat.getColor(this, statusBarColor.resourceId);
</code></pre>

<p>This works flawlessly, I haven't found a similar way to do this below API version 21. (minAPI = 16)</p>

<p>I tried using the <code>getTheme().obtainStyledAttributes()</code>. But, I don't have the <code>AttributeSet</code> to provide to that method since I am using this inside an activity. Am I doing things completely wrong, or is resolving styled attributes not supported on API versions below 21?</p>