小编Yai*_*lka的帖子

Java有像C#的ref和out关键字吗?

类似于以下内容:

参考示例:

void changeString(ref String str) {
    str = "def";
}

void main() {
    String abc = "abc";
    changeString(ref abc);
    System.out.println(abc); //prints "def"
}
Run Code Online (Sandbox Code Playgroud)

例子:

void changeString(out String str) {
    str = "def";
}

void main() {
    String abc;
    changeString(out abc);
    System.out.println(abc); //prints "def"
}
Run Code Online (Sandbox Code Playgroud)

c# java

106
推荐指数
5
解决办法
10万
查看次数

Firebase存储FirebaseApiNotAvailableException在离线时在日志中重复出现

我正在使用:

compile "com.google.firebase:firebase-core:9.0.1"
compile "com.google.firebase:firebase-storage:9.0.1"
Run Code Online (Sandbox Code Playgroud)

这是我在设备离线(没有互联网)的情况执行此代码的代码:

StorageReference mStorageRef = FirebaseStorage.getInstance().getReferenceFromUrl([MY_URL]);
mStorageRef.child("my_file.json").getBytes(Long.MAX_VALUE)
 .addOnSuccessListener(bla bla bla).addOnFailureListener(more bla bla)
Run Code Online (Sandbox Code Playgroud)

每秒都会在日志中重复此消息:

W/ExponenentialBackoff: network unavailable, sleeping.
E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.firebase.FirebaseApiNotAvailableException: firebase-auth is not linked, please fall back to unauthenticated mode.
Run Code Online (Sandbox Code Playgroud)

这是一个错误还是预期的行为?我知道,如果我离线,我将无法获取远程文件,但为什么firebase代码会尝试每秒轮询?

注意:当我再次上线时,它会执行成功/失败监听器并完成轮询.

android firebase-storage

6
推荐指数
1
解决办法
7640
查看次数

标签 统计

android ×1

c# ×1

firebase-storage ×1

java ×1