title: LazyLoader imageLoader null pointer exception?
body: <p>I am currently working on an application that has a List which is populated using the LazyLoader method so I ahve the following classes:</p>
  
  <p>FileCache.java,
  ImageLoader.java,
  LazyAdapter.java,
  Utils.java</p>
  
  <p>Basically the images Load fin when I am populating the List, however I want to then show the image of the selected list item on the single item view when it is selected. So when the user clicks a list item they are taken to a new activity to see all the details around that item. To save database call I have gathered all the needed data in the list and hidden it in field and then I pass it to the single item view using the method below:</p>
  
  <pre><code>String ImageURL = ((TextView) view.findViewById(R.id.ImageURL)).getText().toString();
  
  Intent i = new Intent(getApplicationContext(), VenueItem.class);
  
  i.putExtra("ImageURL", ImageURL);
  
  startActivity(i);
  </code></pre>
  
  <p>This then passes that URL and a bunch of other pieces of data that I am sending over to the new Activity. When it reaches the new activity I am reading that data using the method below:</p>
  
  <pre><code>String image_url;
  
  Intent i = getIntent();
  
  image_url = i.getStringExtra("ImageURL");
  
  ImageView thumb_image=(ImageView) findViewById(R.id.itemImage); // thumb image
  
  imageLoader.DisplayImage(image_url, thumb_image); //This is the line it fails on
  </code></pre>
  
  <p>As you can see I have highlighted the line above where it seems to fail and I get a nullpointerexception error, even though I have debugged the code and when it hits that line the 2 params it is passing are both present. The code for the image loader is below:</p>
  
  <pre><code>final int stub_id = R.drawable.noimage;
      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 think this is something to do with the way I am calling the image loader maybe, can someone please help me with this as it is so annoying?? or can someone tell me of a better way to get the image already cached and displayed in the list to show on the single item activity?</p>
  
  <p>Thanks</p>