title: Exception in ImageLoader fetching images from Parse.com
body: <p>I'm trying to fetch images from Parse.com in the array of ImageViews. However, the app is crashing with nullpointerException in ImageLoader class. I have 5 images in parse.com and 6 ImageViews. one ImageView has an image set in drawable folder. So 5 images get loaded dynamically from parse in array of Imageviews 1-6. HomeActivity is :</p>
  
  <pre><code>ImageView ad1,ad2,ad3,ad4,ad5,ad6;   
  List&lt;ParseObject&gt; ob;
  private ImageView[] imgs = new ImageView[5];
  int k=0;
  public ImageLoader imgl;
  </code></pre>
  
  <p>in onCreate():</p>
  
  <pre><code>imgl=new ImageLoader(getApplicationContext());
  ad1=(ImageView) findViewById(R.id.ad1);
      ad2=(ImageView) findViewById(R.id.ad2);
      ad3=(ImageView) findViewById(R.id.ad3);
      ad4=(ImageView) findViewById(R.id.ad4);
      ad5=(ImageView) findViewById(R.id.ad5);
      ad6=(ImageView) findViewById(R.id.ad6);
       imgs[0] = ad2; 
       imgs[1] = ad3; 
       imgs[2] = ad4; 
       imgs[3] = ad5; 
       imgs[4] = ad6;
  try {
          // Locate the class table named "Footer" in Parse.com
          ParseQuery&lt;ParseObject&gt; query = new ParseQuery&lt;ParseObject&gt;("Adverts");
          query.orderByDescending("updatedAt");
          query.whereEqualTo("Status", true);
          ob = query.find();
          for (ParseObject country : ob) {
              ParseFile image = (ParseFile) country.get("imageFile");
              imgl.DisplayImage(image.getUrl(), imgs[k]);
              k=k+1;
              System.out.println("the urls are"+image.getUrl());
  
          }
      } catch (ParseException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>In ImageLoader class:</p>
  
  <pre><code> public ImageLoader(Context context) {
      fileCache = new FileCache(context);
      executorService = Executors.newFixedThreadPool(5);
  }
  
  final int stub_id = R.drawable.ic_launcher;
  
  public void DisplayImage(String url, ImageView imageView) {
      imageViews.put(imageView, url);
      Bitmap bitmap = memoryCache.get(url);
      if (bitmap != null)
          imageView.setImageBitmap(bitmap);
      else {
          queuePhoto(url, imageView);
          imageView.setImageResource(stub_id);
      }
  }
  </code></pre>
  
  <p>I'm getting nullpointer at <code>imageView.setImageResource(stub_id);</code></p>
  
  <p>Please help.</p>