title: Android Firebase - User Registration with Profile Photo
body: <p>I have been looking through the Firebase documentation, as well as searches on stackoverflow, google, and YouTube for the following:</p>
  
  <p>Creating a user registration that allows for email, password, and profile photo.</p>
  
  <p>I am able to successfully add a user with their email and password but I can't seem to get the other information in(most importantly the profile photo). All the tutorials and documentation show how someone who is ALREADY a (logged in) User can upload a photo to firebase, but not for someone that's registering. Can someone help out here, how can I get the profile photo and first/lastname uploaded with the new users?</p>
  
  <p>I am using FirebaseAuth to add the users.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>checkmarkImage.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
  
  
          auth.createUserWithEmailAndPassword(emailET.getText().toString(), passwordET.getText().toString())
              .addOnCompleteListener(RegisterActivity.this, new OnCompleteListener() {
                              @Override
                              public void onComplete(@NonNull Task task) {
                                          Toast.makeText(RegisterActivity.this, "createUserWithEmail:onComplete:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
                                            //progressBar.setVisibility(View.GONE);
                                  if (!task.isSuccessful()) {
                                                Toast.makeText(RegisterActivity.this, "Authentication failed." + task.getException(),
                                                        Toast.LENGTH_SHORT).show();
                                  } else {
                                          startActivity(new Intent(RegisterActivity.this, HomeActivity.class));
                                          finish();
                                            }
                                            }
                                    });
                        }
                    });
  
          uploadProfilePhoto.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  handleChooseImage(view);
              }
          });
  
  
      }
  
      //END OF onCreate
  
      //Separate methods
  
      //Actually opens the CameraRoll
          public void handleChooseImage(View v) {
              Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
              startActivityForResult(i, SELECTED_PICTURE);  //then goes to onActivityResult
          }
          public void handleInsertData(View v) {
  
          }
  
      public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
          super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
          switch (requestCode) {
              case 0:
                  if(requestCode == RESULT_OK) {
                      Log.i("RegisterActivity", "case 0");
                  }
                  break;
              case 1:
                  if(resultCode == RESULT_OK) {
                      Uri selectedImage = imageReturnedIntent.getData();
                      Log.i("RegisterActivity", "selected image = " + selectedImage);
  
                  }
                  break;
          }
      }
  }
  </code></pre>