我正在尝试从 firebase 存储中下载一些文件。当有稳定的互联网连接时,它工作得很好。但是,如果在下载内容中途断开互联网连接,它只会继续尝试下载内容。如何检测是否没有下载内容?
我已经实施onProgessListener
了StorageReference
. 但是,我不确定如何使用它来检测下载是否没有进度。
new OnProgressListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onProgress(FileDownloadTask.TaskSnapshot taskSnapshot) {
//What to do with the taskSnapshot to detect if there are no progress in the download?
}
};