daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. imageFilesPath = storageReference.child("Your_collection Name" + "/"+ "Image_name"+ ".jpg");
  2.  
  3.   imageFilePath.putFile(image_Uri).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
  4.         @Override
  5.         public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
  6.             if (task.isSuccessful() && task != null) {
  7.                 imageUrl = task.getResult().getDownloadUrl().toString();
  8.           }
  9.             }
  10.     });
  11.    
  12. filePath.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
  13.     @Override
  14.     public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
  15.         filePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
  16.             @Override
  17.             public void onSuccess(Uri uri) {
  18.                 Log.d(TAG, "onSuccess: uri= "+ uri.toString());
  19.             }
  20.         });
  21.     }
  22. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top