【发布时间】:2021-12-30 10:18:08
【问题描述】:
首先我以这种方式保存数据form
Save.setOnClickListener(new View.OnClickListener() {
@RequiresApi(api = Build.VERSION_CODES.GINGERBREAD)
@Override
public void onClick(View v) {
String refernce = TextRef.getEditText().getText().toString();
String nompdv = textNomPdv.getEditText().getText().toString();
String etat = textEtatCommande.getEditText().getText().toString();
String datecommande = TextDateCommande.getEditText().getText().toString();
String produitcommande = textProduit.getEditText().getText().toString();
String qntcommande = editTextProduitQnt.getEditText().getText().toString();
DatabaseReference newPost = reference.child(refernce);
newPost.child("refernce").setValue(refernce);
newPost.child("nompdv").setValue(nompdv);
newPost.child("etat").setValue(etat);
newPost.child("datecommande").setValue(datecommande);
newPost.child("user_id").setValue(uid);
DatabaseReference newOrder = reference.child(refernce).child("produit");
newOrder.child(produitcommande).setValue(qntcommande);
}
});
我只想使用地图保存“produit”(红色数据):“produitcommande”和“qntcommande”:
【问题讨论】:
标签: java android firebase firebase-realtime-database android-recyclerview