title: How to access drawable from non activity class
body: <p>I am in a situation where I have to use the <code>drawable folder</code> of my app form a non activity class. I tried using the parent activity with the following code:</p>
  
  <pre><code>ParentActivity pa = new ParentActivity();
  Drawable d = pa.getResources()..getDrawable(R.drawable.icon);`
  </code></pre>
  
  <p>But this returns me a <code>NulLPointerException</code>. 
  How can I achieve this?</p>