如何使用recyclerview从Firebase数据库检索图像

问题描述 投票:0回答:1
   holder.txcom.setText("Comments: "+wtm.getWorkcom());
       Picasso.get().load(wtm.getImageurl()).into(holder.imgwaste);
        Toast.makeText(context, ""+wtm.getImageurl(), Toast.LENGTH_SHORT).show();

这是我的代码,用于从Firebase检索图像。我使用了Glide和Picasso,但没有显示图像。在Toast中,图像链接可以显示存储在Firebase数据库上的链接。但不显示图像。

android
1个回答
0
投票

1)将上下文添加到yourAdapter构造器:

public yourAdapter(Context context){
        this.context=context;
       }

2)并尝试此

Picasso.with(context).load(yourUrl).into(imageView);
© www.soinside.com 2019 - 2024. All rights reserved.