Я сохранил некоторые файлы документов в папке "Colleges_names" в хранилище Firebase.Я хочу скачать их в моем приложении для Android.Когда я нажимаю нужную кнопку для загрузки файла, ничего не происходит.
public void onClick(View view) {
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReferenceFromUrl("gs://du-admissions-app.appspot.com");
StorageReference islandRef = storageRef.child("COLLEGES-NAMES").child("CLG_BA(ENGLISH).docx");
File rootPath = new File(Environment.getExternalStorageDirectory(), "file_name");
if(!rootPath.exists()) {
rootPath.mkdirs();
}
final File localFile = new File(rootPath,"CLG_BA(ENGLISH).docx");
islandRef.getFile(localFile).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
Log.e("firebase ",";local tem file created created " +localFile.toString());
// updateDb(timestamp,localFile.toString(),position);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.e("firebase ",";local tem file not created created " +exception.toString());
}
});