你好,我试图在我的应用程序中添加一个配置文件图像,但是它没有显示图像,我得到了这个错误,我也试图添加用户适配器,它没有显示,我也不能解决这个问题,谢谢您的回答
错误消息
2022-01-28 08:32:18.553 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.568 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.742 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
2022-01-28 08:32:18.785 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource这里是我的代码
private void userInfo(){
DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users").child(profileid);
reference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (getContext() == null){
return;
}
User user = dataSnapshot.getValue(User.class);
Glide.with(getContext()).load(user.getImageurl()).into(image_profile);
username.setText(user.getUsername());
fullname.setText(user.getFullname());
bio.setText(user.getBio());
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}我使用的是hdodenhof:circleimageview版本
implementation 'de.hdodenhof:circleimageview:3.1.0'这里是我的布局代码
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:id="@+id/image_profile"/>发布于 2022-01-28 07:30:58
我试图打开从您日志gs://travelinstam2.appspot.com/placeholder.png中提取的链接中的资源,但它失败了。
您检查了资源URL是否正确且可访问吗?
的回答:根据我们在评论部分的讨论,问题是提供给Glide.的网址。
https://stackoverflow.com/questions/70889416
复制相似问题