我想在我的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是 –