I want to store users information by adding a key with its map object
private void createUserData() {
Toast.makeText(LoginActivity.this, "test begin",
Toast.LENGTH_SHORT).show();
DatabaseReference usersRef = FirebaseDatabase.getInstance().getReference().child("users");
//set fields data
Map<String, String> userData = new HashMap<>();
userData.put("userId", "test id ");
userData.put("email", "as@gmail");
userData.put("userName", "abdo");
usersRef.child("userkey").setValue(userData);
Toast.makeText(LoginActivity.this, "test end",
Toast.LENGTH_SHORT).show();
}
when i click the button to trigger this code, the both Toast objects show up but no node added to users node. whats wrong with this code to write data to firebase database ?