title: Cannot access none static methods from static method, Android: getResources() from the type ContextWrapper
body: <p>I have a static class containing overlay items that is called by my main class and then added to an overlay itself.</p>
  
  <p>I can get this to work without image types but I would like to use them, however when I do I get the following error: 
  Cannot make a static reference to the non-static method getResources() from the type ContextWrapper</p>
  
  <p>I have tried quite a few things to overcome this, by following some guides I have tried to add:</p>
  
  <pre><code>     private static Context context;
  
      public void onCreate(){
          super.onCreate();
          Mine.context = getApplicationContext();
      }
  
      public static Context getAppContext() {
          return Mine.context;
      }
  </code></pre>
  
  <p>I have also ensured that I have the class in question as an application in the manifest.</p>
  
  <p>The class is as follows:</p>
  
  <pre><code>    public static ArrayList&lt;ExtendedOverlayItem&gt; array = new ArrayList&lt;ExtendedOverlayItem&gt;();
  
  public ArrayList&lt;ExtendedOverlayItem&gt; getMine() {
      return array;
  }
  
  
  
  public static  void addMe() {
      Drawable myDrawable = getResources().getDrawable(R.drawable.draw);  //This is the line that doesn't work
      ExtendedOverlayItem myMarker1 = new ExtendedOverlayItem(
              "sample", "sample", new GeoPoint(85.123456,
                      -14.123456), null);
      myMarker1.setMarker(myDrawable);
  
      myMarker1.setDescription("This is a test description");
      array.add(myMarker1);
  }
  
   private static Context context;
  
      public void onCreate(){
          super.onCreate();
          Mine.context = getApplicationContext();
      }
  
      public static Context getAppContext() {
          return Mine.context;
      }
  </code></pre>
  
  <p>I have tried adding the following :</p>
  
  <pre><code>myMarker1.setMarker(Mine.getAppContext().getResources().getDrawable(R.drawable.example));
  </code></pre>
  
  <p>But I still get null pointer errors when calling from the main method, If I leave the images out, it is called correctly.</p>
  
  <p>In the main method I call this class as follows:</p>
  
  <pre><code>Mine.addMe();
  ItemizedOverlayWithBubble&lt;ExtendedOverlayItem&gt; thisThing = new   ItemizedOverlayWithBubble&lt;ExtendedOverlayItem&gt;(this, Mine.array, map);
  map.getOverlays().add(thisThing);
  </code></pre>
  
  <p>Any advice greatly appreciated. </p>