title: Android BitmapFactory doesn't get from inputstream on AsyncTask onPostExecute
body: <p><strong>I get Inputstream file in <code>doInBackground</code> then return this inputstream. this my code</strong></p>
  
  <pre><code> class PhotoAddTask extends AsyncTask&lt;Void, Integer, InputStream&gt; {
      public PhotoAddTask(ProgressDialog dialog) {
          this.dialog = dialog;
      }
  
      @Override
      protected void onPreExecute() {
          dialog.setMessage("Doing something, please wait.");
          dialog.show();
      }
  
      @Override
      protected InputStream doInBackground(Void... voids) {
  
             InputStream inputStream = null;
              try {
                  String url = "http://some-url"
                  inputStream = getImageFromURL(url);
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return inputStream;
         }
  
      @Override
      protected void onPostExecute(InputStream inputStream) {
          if (dialog.isShowing()) {
              dialog.dismiss();
          }    
           photoImage.setImageBitmap(BitmapFactory.decodeStream(inputStream));
  
      }
  }
  
  public BufferedHttpEntity getImageFromURL(String fileUrl) {
      BufferedHttpEntity breader = null;
      try {
          HttpGet httpRequest = null;
  
          httpRequest = new HttpGet(fileUrl);
          HttpClient httpclient = new DefaultHttpClient();
  
          HttpResponse response = null;
          response = (HttpResponse) httpclient.execute(httpRequest);
          HttpEntity entity = response.getEntity();
          breader = new BufferedHttpEntity(entity);
  
      } catch (IOException e) {
          e.printStackTrace();
      }
      return breader;
  </code></pre>
  
  <p>Q: I get Inputstream file in doInBackground then return this inputstream, 
  and I set </p>
  
  <p><code>photoImage.setImageBitmap(BitmapFactory.decodeStream(inputStream))</code> </p>
  
  <p>in <code>onPostExecute()</code> but </p>
  
  <p><code>BitmapFactory.decodeStream(inputStream)</code> return <code>null</code>.</p>
  
  <p>What could be wrong with this code?</p>