How do you upload an image that will also have the current user's UID attached?
This is the code I am using to upload the image, but so far having no success adding on the UID.
private void updloadImage(Uri pickedImage){
StorageReference myStorage = FirebaseStorage.getInstance().getReference().child("users_photos");
final StorageReference imagePath = myStorage.child(pickedImage.getLastPathSegment());
userID = fAuth.getCurrentUser().getUid();
imagePath.putFile(pickedImage).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
imagePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
UserProfileChangeRequest myUpdate = new UserProfileChangeRequest.Builder().setPhotoUri(uri).build();
}
});
}
});