title: Return the method after download is success
body: <p>I am trying to download an image from the firebase storage and show the image after downloading it.
  Is there any way to return my method only after the download complete?</p>
  
  <p>here's the code of my method:</p>
  
  <pre><code>public void downloadImagesFromFireStorage(final String couponName, String imgName) {
  
      finish = false;
  
      StorageReference storageRef = FirebaseStorage.getInstance()
          .getReferenceFromUrl("gs://xxxxx.appspot.com").child("imgs").child(imgName);
  
      final long ONE_MEGABYTE = 1024 * 1024;
  
      storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener&lt;byte[]&gt;() {    
          @Override
          public void onSuccess(byte[] bytes) {
              Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
              saveBitmap(couponName, bitmap);
          }
      });
  
      final ProgressDialog progressDialog = new ProgressDialog(context);
      progressDialog.setTitle("Downloading..");
      progressDialog.setMessage("Now download " + couponName + "....");
      progressDialog.show();
  }
  </code></pre>