【发布时间】:2019-08-29 11:47:18
【问题描述】:
我正在登录屏幕。
但是,当我在填写完 ID 和 pw 后运行代码时,userId(下面的代码)仍然为空。
foundUser = dataSnapshot.getValue(User.class);
userId = foundUser.getId();
userPw = foundUser.getPw();
我的应用程序肯定已连接到 Firebase。但是,当我调试代码时,我可以看到 W/ClassMapper:在类 com.example.hellobook.User 上找不到 exampleuserID 的设置器/字段
【问题讨论】:
-
请提供您的数据库结构以及为什么为数据库参考分配变量?
-
@Ashish 我的用户数据库包含布尔值 admin / firstName / id / lastName / numBookReports / pw 我刚刚分配了它,因为我认为它在某些程度上可能有用
-
请张贴截图,以便我们正确理解问题。
-
@Ashish 我贴出来了