Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试上传到 GcmTaskService 内的 Firebase 存储。我想同步上传,但所有上传方法(putBytes、putFile...)都是异步的。
我没有找到任何方法等到上传完成。有什么办法可以同步上传吗?
是的,如果您不在 UI 线程上,您可以使用 方法阻塞直到任务完成
com.google.android.gms.tasks.Tasks.await(task);