Android Studio图片显示问题

时间:2018-11-14 00:36:18

标签: android firebase firebase-storage

用于显示图像的方法的原始代码为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);

0 个答案:

没有答案