配列を含むfirebaseデータベースにオブジェクトを保存したい。私はこれを使用する場合データベースに配列を持つオブジェクトを追加するFireBase
は:
mDatabaseReference.child("user").child(id).setValue(user);
は、私は私のデータベース内の配列を参照してくださいいけません。
が#####これは私のクラスのユーザ情報である
#####に編集:
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);
}
とそのまだ動作していない、私はMTデータベースのルートに私のハッシュを参照してくださいいけません: 私が使用する場合
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はい –