How do I download an image from Firebase Storage on Android?

Viewed 7919

I'm using Firebase Storage to store images. I can't download these on the Android. I want to download all images of folder but for now I want to download just one, because I don't know how to download all images as a list yet. I'm trying this

public static final String TAG = "AtividadesFragment";
    ImageView imageView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_atividades,container,false);
        Log.i(TAG,"onCreateView()");
        imageView = (ImageView) v.findViewById(R.id.image);
        return v;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        FirebaseStorage storage = FirebaseStorage.getInstance();
        StorageReference ref = storage.getReference().child("ImagensExercicios/abdominal_1.bmp");

        Glide.with(getActivity()).using(new FirebaseImageLoader()).load(ref).into(imageView);
    }

Xml:

<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</android.support.constraint.ConstraintLayout>

But nothing happens.

enter image description here

2 Answers
Related