我试图检索的是数据库中的用户 id,以显示除该用户之外的所有在线用户,但是除了导致的 id 之外,所有数据库信息都被存储以下崩溃E/UncaughtException:java.lang.NullPointerException:尝试在 USER.UsersFragment$1.onDataChange(UsersFragment.java:63) 处的空对象引用上调用虚拟方法“boolean java.lang.String.equals(java.lang.Object)” )。这是我的用户文件 public class User { private String id; private String username; private String first_name; private String last_name; private String birthday; private String email; private String imageURL; public User(String id, String username, String first_name, String last_name, String birthday, String email, String imageURL) { this.id = id; this.username = username; this.first_name = first_name; this.last_name = last_name; this.birthday = birthday; this.email = email; this.imageURL = imageURL; } public User() { } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getFirst_name() { return first_name; } public void setFirst_name(String first_name) { this.first_name = first_name; } public String getLast_name() { return last_name; } public void setLast_name(String last_name) { this.last_name = last_name; } public String getBirthday() { return birthday; } public void setBirthday(String birthday) { this.birthday = birthday; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getImageURL() { return imageURL; } public void setImageURL(String imageURL) { this.imageURL = imageURL; }}
添加回答
举报
0/150
提交
取消