I've got GridView adapter and I want to download photos from Firebase Storage via photo's URL.
When I am passing the URL to the GridViewAdapter the photo is blank. There is space but there is no picture. Like the transparent picture.
If I pass the images' URL found in Google it works, but it does not work with Firebase Storage's URL. What is wrong?
This is how I try to get URL from Firebase Storage I am getting DataSnapshot of node which contains all URLs
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
photos.clear();
for(DataSnapshot ds: dataSnapshot.getChildren()){
String photoURL = ds.getValue(String.class);
try {
photos.add(photoURL);
}catch (NullPointerException e) {
}
}
gridViewAdapter = new GridViewAdapter(getContext(), photos);
gridView.setAdapter(gridViewAdapter);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
my GridViewAdapter.class, getView method
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View gridView = convertView;
if(convertView == null){
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
gridView = inflater.inflate(R.layout.image_item,null);
}
ImageView imageView = gridView.findViewById(R.id.image_from_photo_album);
Picasso.with(context).load(photos.get(position)).into(imageView);
return imageView;
}
ScreenView without Firebase Storage URL:
ScreenView with Firebase Storage URL: