用于显示图像的方法的原始代码为taskSnapshot.getDownloadUrl()
,但现在已弃用。
新方法taskSnapshot.getMetadata().getReference().getDownloadUrl()
不会存储上传图像的实际URL,但是我不确定要存储实际图像URL需要采用什么方法?
//used to get create a new entry in database which saves the metadata
Toast.makeText(UploadProjectActivity.this, "Upload Successful", Toast.LENGTH_LONG).show();
UploadClass upload = new UploadClass(EditTextFileName.getText().toString().trim(),
taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());
String uploadId = DatabaseRef.push().getKey();
DatabaseRef.child(uploadId).setValue(upload);