title: Async Task onPost throws exception
body: <p>I am downloading image from firebase in async task and then place it in a imageview and till here, all is fine. In onPostExecute() method, I want to get the drawable from the imageview I put image in in the first step but it throws exception as it imageview contains nothing.</p>
  
  <pre><code>public class DownloadPhoto extends AsyncTask&lt;Void, Void, Void&gt; {
      @Override
      protected Void doInBackground(Void... params) {
          downloadImage();
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          super.onPostExecute(result);
          Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
          Palette colorPalette = Palette.from(bitmap).generate();
          int darkVibrantColor = colorPalette.getDarkVibrantColor(Color.parseColor("#546369"));
          title.setTextColor(darkVibrantColor);
          details.setTextColor(darkVibrantColor);
      }
  
  }
  </code></pre>
  
  <p>I do not have any problem with downloading, it downloads and puts image in imageview correctly. I though, I am better off downloading image in main treat not in async task but not sure if it is okay.</p>
  
  <p>Download image function</p>
  
  <pre><code>private void downloadProfileImage() {
      downloadImage = new DownloadImage("image_" + id + ".jpg", storageReference);
      downloadImage.download(image);
  }
  </code></pre>
  
  <p>Download Class</p>
  
  <pre><code>public class DownloadImage {
  private String name;
  private StorageReference storageReference;
  
  public DownloadImage(String name, StorageReference storageReference) {
      this.name = name;
      this.storageReference = storageReference;
  }
  
  public void download(final ImageView ımageView) {
      StorageReference sRef = storageReference.child("images/" + name);
      sRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener&lt;Uri&gt;() {
          @Override
          public void onSuccess(Uri uri) {
              Picasso.get().load(uri).into(ımageView);
          }
      }).addOnFailureListener(new OnFailureListener() {
          @Override
          public void onFailure(@NonNull Exception e) {
              Log.i("resultDownload", e.getLocalizedMessage());
          }
      });
  }
  }
  </code></pre>