title: How to get Images from resources mipmap using a Java class
body: <p>I have created a Java class file in Android Studio but I don't know how I will get images from mipmap. I have tried to add Context but it is not working.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by Ineza on 18/11/2016.
   */
  
  public class DerpData {
      private static final String[] titles = {
          "Nothingness cannot be  defined",
          "The softest thing cannot be snapped",
          "be like water, my friend."
      };
      private static final int[] icons = ;
  
      public static List&lt;LisItem&gt; getListData() {
          List&lt;LisItem&gt; data = new ArrayList&lt;&gt;();
  
          // Repeat process 4 times, so that we have enough data to demonstrate a scrollable
          // RecyclerView
          for (int x = 0; x &lt; 4; x++) {
              //create ListItem with dummy data, then add them to our List
              for (int i = 0; i &lt; titles.length &amp;&amp; i &lt; icons.length; i++) {
                  LisItem item = new LisItem();
                  item.setImageResId(icons[i]);
                  item.setTittle(titles[i]);
                  data.add(item);
              }
          }
          return data;
      }
  }
  </code></pre>
  
  <p>I have used the following block of code but it is not working:</p>
  
  <pre><code>public class DerpData extends Application{
      private static Context mContext;
  
      @Override
      public void onCreate() {
          super.onCreate();
          mContext = this;
      }
  
      public static Context getContext(){
          return mContext;
      }
  
      private static final int[] icons = Resources.getSystem().getIntArray(android.R.array.imgs)
  }
  </code></pre>
  
  <p>in values ihave xml file 'images'</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
  &lt;integer-array name="imgs"&gt;
      &lt;item&gt;@mipmap/computer&lt;/item&gt;
      &lt;item&gt;@mipmap/house&lt;/item&gt;
      &lt;item&gt;@mipmap/sunflower&lt;/item&gt;
      &lt;item&gt;@mipmap/dog&lt;/item&gt;
  &lt;/integer-array&gt;
  &lt;/resources&gt;
  </code></pre>