如何从Firebase存储直接将imagem URL检索到imagemview?

时间:2019-03-13 03:43:59

标签: android firebase firebase-storage

如何检索从Firebase存储上载到ImageView的图像?我已经将ImageView从我的PC上传到存储设备,现在需要将其检索到应用程序内的ImageView。我该怎么办?

这就是我要尝试的方式。

db.collection("Ads").document("Ads1").addSnapshotListener(new EventListener<DocumentSnapshot>() {
            @Override
            public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {

                String titulo = documentSnapshot.getString("titulo");
                String subtitulo = documentSnapshot.getString("subtitulo");
                String imagem1 = documentSnapshot.getString("imagem1");

                textViewAdsTitulo.setText(titulo);
                textViewAdsSub.setText(subtitulo);
                imageView1.setImageURI();//Can't get i as string;

1 个答案:

答案 0 :(得分:0)

使用毕加索

首先在build.gradle>依赖项中添加implementation 'com.squareup.picasso:picasso:2.71828

然后使用Picasso.get().load(your_url).into(your_imageView)