title: Why is BitmapFactory.decodeStream returning null?
body: <p>Basically I am parsing some JSON that has an image with it and trying to load it into a ImageView. However <strong>mBitmap</strong> is returning null. I have no idea why and further research has not helped..</p>
  
  <p>Here is an example url I am working with:</p>
  
  <pre><code>http://b.thumbs.redditmedia.com/ivBAJzLMJEkEy9jgTy3z4n-mO7gIGt5mQFU1Al5kJ-I.jpg
  </code></pre>
  
  <p>Here is all relevant code:</p>
  
  <pre><code> public static Bitmap LoadImageFromUrl(String url){
     try {
        mBitmap = BitmapFactory.decodeStream((InputStream)new URL(url).getContent());
         return mBitmap;
      }catch (Exception e){
         Log.d(TAG,"Error getting image");
         return null;
     }
  }
  </code></pre>
  
  <p>Here is where the method is called:</p>
  
  <pre><code>mListingModel.setmImageView(LoadImageFromUrl(data.getString(JSON_THUMBNAIL)));
  </code></pre>
  
  <p>Here is where I set the ImageView:</p>
  
  <pre><code>    if(mItem.getmImageView() != null) {
          holder.imageView.setImageBitmap(mItem.getmImageView());
      }
  </code></pre>
  
  <p><strong>Note: I am calling the method in an AsyncTask so that is not the problem.</strong></p>