Skip to content

Instantly share code, notes, and snippets.

@AnkitSuda
Created January 22, 2018 12:20
Show Gist options
  • Select an option

  • Save AnkitSuda/34d2e3d3619dba8f6699af41ed8e75b7 to your computer and use it in GitHub Desktop.

Select an option

Save AnkitSuda/34d2e3d3619dba8f6699af41ed8e75b7 to your computer and use it in GitHub Desktop.
FRA add data
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference().child("posts").push();
Map<String, Object> map = new HashMap<>();
map.put("id", databaseReference.getKey());
map.put("title", editText.getText().toString());
map.put("desc", etd.getText().toString());
databaseReference.setValue(map);
}
});
@mbganesh
Copy link
Copy Markdown

mbganesh commented Jun 28, 2020

can you tell me what is those parameters

      map.put( ** "id", databaseReference.getKey() ** );
      map.put(**"title", editText.getText().toString()**);
      map.put(**"desc", etd.getText().toString()**);

how i identify ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment