title: How do I save data to firebase using a randomID?
body: <p>I wish to replace the words "one" that is highlighted in yellow with random IDs generated by firebase the same way my child nodes are randomly generated IDs using the push method.
  <img src="https://i.stack.imgur.com/AXspP.png" alt="I hope this picture can better explain my question."></p>
  
  <pre><code>FirebaseDatabase database = FirebaseDatabase.getInstance();
  final DatabaseReference Med_History = database.getReference("Patient_Medication_History");
  
  Med_History.child(SignInIC.CustomUID).addListenerForSingleValueEvent(new ValueEventListener() {
      @Override
      public void onDataChange(@NonNull DataSnapshot dataSnapshot)
      {
          String taken = "Taken";
          String date = formattedDate.toString();
          String time = formattedTime.toString();
          String status = taken.toString();
          String medication = TV.getText().toString();
          String month = formattedMonth.toString();
  
          String combined = medication + " - " + status + " at " + time + " on " + date;
          String one = combined;
  
          Medication_History medication_history = new Medication_History(one);
          Med_History.child(SignInIC.CustomUID).child(month).setValue(medication_history);
  
          Intent Register_SignIn = new Intent(Medication_Attendance.this, HomeActivity.class);
          startActivity(Register_SignIn);
          finish();
      }
  
      @Override
      public void onCancelled(@NonNull DatabaseError databaseError) {
      }
  });
  public class Medication_History {
  
      private String One;
  
      public Medication_History() {
      }
  
      public Medication_History(String one) {
          One = one;
      }
  
      public String getOne() { return One; }
  
      public void setOne(String one) { One = one; }
  }
  </code></pre>