CS Downloading Image

Advertisements
 public void downloadPhoto(View view) {
        StorageReference imageReference = FirebaseStorage.getInstance().getReference().child("images/1.png");

        imageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
            @Override
            public void onSuccess(Uri uri) {
                //Setting the image to imageView using Glide Library
                Glide.with(MainActivity.this).load(uri.toString()).into(mImageView);
            }
        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                Log.e(TAG, "onFailure: something went wrong: "+ e.getMessage() );

            }
        });

    }