title: How to access a drawable in android Java
body: <p>I am developing an android app and I  need to know how to reference a drawable in my java code. The image/drawable is in my drawable folder and it is referenced in my xml. How do I then access it in my activity (Java code).</p>
  
  <p>In my xml I have</p>
  
  <pre><code>android:src="@drawable/medkit"
  </code></pre>
  
  <p>and in my android activity class: </p>
  
  <pre><code>  ArrayList&lt;String&gt; child = new ArrayList&lt;String&gt;();
        child.add("In plaster walls, strips of metal mesh bent at right angles and embedded in corners of ceilings and walls to prevent the plaster from cracking.");
        child.add( R.drawable.ic_medkit );
   child.add( R.drawable.medkit );
  </code></pre>