Good morning,
I'm starting with programming, and I have the following question. 1. I can enter data in the firebase, but when I try to insert it again, only replacing the data occurs instead of inserting the new record.
Good morning,
I'm starting with programming, and I have the following question. 1. I can enter data in the firebase, but when I try to insert it again, only replacing the data occurs instead of inserting the new record.
Try this.
DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("tasks").push().setValue(firebaseData, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {
//Problem with saving the data
if (databaseError != null) {
} else {
//Data uploaded successfully on the server
}
}
});