我想在我的firebase数据库中保存一个对象,其中包含一个数组。添加一个数组到数据库的对象FireBase
当我使用这个:
mDatabaseReference.child("user").child(id).setValue(user);
我没有看到我的数据库中的数组。
#####编辑#####
这是我的课UserInformation:
public class UserInformation {
private String email1;
private String Password1;
public HashMap<String, Boolean> levels=new HashMap<>();
public UserInformation (String email, String Password){
this.email1=email;
this.Password1=Password;
levels.put("level1", false);
levels.put("level2", false);
levels.put("level3", false);
}
其仍然没有工作,我没有看到我的散列吨数据库的根: 当我使用
UserInformation user=new UserInformation(email1,password1);
String id=mDatabaseReference.push().getKey();
mDatabaseReference.child("user").child(id).setValue(user);
startActivity(new Intent(getApplicationContext(),ProfileActivity.class));
我能做些什么呢?
发布您的firebase树结构,屏幕截图会很好 –
您看到了什么**吗?是否添加了对象的其余部分? –
@ cricket_007是 –