title: Android-Java Can't write to firebase Realtime database
body: <p>I'm unable to write into my database, I've looked at tutorial videos and changed it to look like theirs each time but it still won't write. I have the database read and write rules set to true. Here is my Gradle dependencies:</p>
  <pre><code>implementation 'com.google.firebase:firebase-auth:19.2.0'
  implementation 'com.google.firebase:firebase-database:19.2.0'
  implementation 'com.google.firebase:firebase-storage:19.1.1'
  implementation 'com.google.firebase:firebase-database:19.6.0'
  implementation 'com.google.firebase:firebase-firestore:21.4.2'
  </code></pre>
  <p>In the AndroidManifest.xml I have the Internet permission:</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  </code></pre>
  <p>Here is the code that is trying to write to the database:</p>
  <pre><code>private EditText editTextUsername, editTextPhone;
  private Button buttonSave;
  
  private FirebaseDatabase db;
  public DatabaseReference databaseReference;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_edit_profile);
      Toolbar toolbar = findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
  
     // firebaseAuth = FirebaseAuth.getInstance();
  
      editTextUsername = findViewById(R.id.editTextUsername);
      editTextPhone = findViewById(R.id.editTextPhone);
      buttonSave = findViewById(R.id.buttonSave);
  
      db = FirebaseDatabase.getInstance();
      databaseReference = db.getReference();
  
  
  
      buttonSave.setOnClickListener(new View.OnClickListener(){
  
          @Override
          public void onClick(View v) {
              String username = editTextUsername.getText().toString();
              databaseReference.setValue(username);
          }
      });
  
  }
  </code></pre>
  <p>I'm not getting any errors but it won't send to the database, I've checked the button and that works.</p>