title: Get attr color value based on current set theme
body: <p>In my activity I'm maintaining a <code>SuperActivity</code>, in which I'm setting the theme.</p>
  
  <pre><code>public class SuperActivity extends Activity {
  @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setTheme(R.style.MyTheme);
      }
  }
  </code></pre>
  
  <p><strong>themes.xml</strong></p>
  
  <pre><code>&lt;!-- ImageBackround --&gt;
  &lt;style name="Theme.MyTheme" parent="ThemeLight"&gt;
      &lt;item name="myBgColor"&gt;@color/translucent_black&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>Now I want to fetch this color in one of my child activity.</p>
  
  <p>As mentioned in this probable <a href="https://stackoverflow.com/questions/9398610/how-to-get-the-attr-reference-in-code">answer</a>, I wrote:</p>
  
  <pre><code>int[] attrs = new int[] { R.attr.myBgColor /* index 0 */};
  TypedArray ta = ChildActivity.this.obtainStyledAttributes(attrs);
  int color = ta.getColor(0, android.R.color.background_light);
  String c = getString(color);
  ta.recycle();
  </code></pre>
  
  <p>But everytime I'm getting the value of the default value of <code>android.R.color.background_light</code> &amp; not of <code>R.attr.myBgColor</code>.</p>
  
  <p>Where I'm doing wrong. Am I passing the wrong context of <code>ChildActivity.this</code>?</p>