title: Upload multiple images to firebase storage
body: <p>i build a chat application using firebase and i want to send multiple image to firebase storage.</p>
  
  <p>using this library</p>
  
  <p>compile 'com.github.darsh2:MultipleImageSelect:3474549'</p>
  
  <p>At the top</p>
  
  <pre><code>private StorageReference storageRef;
  private FirebaseApp app;
  private FirebaseStorage storage;
  </code></pre>
  
  <p>onCreate()Method</p>
  
  <pre><code>app = FirebaseApp.getInstance();
  storage =FirebaseStorage.getInstance(app);
  </code></pre>
  
  <p>button click action</p>
  
  <pre><code>   Gallary.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
                  Intent intent = new Intent(ChatActivity.this, AlbumSelectActivity.class);
                  intent.putExtra(Constants.INTENT_EXTRA_LIMIT, 10);
                  startActivityForResult(intent, Constants.REQUEST_CODE);
                  pwindo1.dismiss();
              }
          });
  </code></pre>
  
  <p>Activity result</p>
  
  <pre><code>    if (requestCode == Constants.REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {
          ArrayList&lt;Image&gt; images = data.getParcelableArrayListExtra(Constants.INTENT_EXTRA_IMAGES);
          Uri uri = Uri.parse(String.valueOf(images));
          storageRef = storage.getReference("photos");
          final StorageReference photoRef = storageRef.child(uri.getLastPathSegment());
          photoRef.putFile(uri)
                  .addOnSuccessListener(this, new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                          Uri downloadUrl = taskSnapshot.getDownloadUrl();
                          String content = downloadUrl.toString();
                          if (content.length() &gt; 0) {
                              editWriteMessage.setText("");
                              Message newMessage = new Message();
                              newMessage.text = content;
                              newMessage.idSender = StaticConfig.UID;
                              newMessage.idReceiver = roomId;
                              newMessage.timestamp = System.currentTimeMillis();
                              FirebaseDatabase.getInstance().getReference().child("message/" + roomId).push().setValue(newMessage);
                          }
                      }
                  });
  
      }
  </code></pre>