title: Firebase: Database not updating
body: <p><a href="https://i.stack.imgur.com/g83i2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g83i2.png" alt="enter image description here" /></a></p>
  <p>I am using Firebase for the first time in Android studio.  I connected using android assistant and I want to add a food name, category and best before date. When I click add food button nothing is updating. I have updated the read write rules to true and the assistant says the database is connected.
  Am I missing a connection somewhere?</p>
  <p><a href="https://i.stack.imgur.com/5fvzS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5fvzS.png" alt="enter image description here" /></a></p>
  <p>Here is my code:</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  EditText editTextName;
  Button buttonAdd;
  Spinner spinnerCategory;
  EditText editTextDate;
  
  DatabaseReference databaseFood;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      databaseFood = FirebaseDatabase.getInstance().getReference(&quot;Food&quot;);
  
      editTextName = (EditText) findViewById(R.id.editTextName);
      buttonAdd = (Button) findViewById(R.id.buttonAddFood);
      spinnerCategory = (Spinner) findViewById(R.id.spinnerCategory);
      editTextDate = (EditText) findViewById(R.id.editTextDate);
  
  
      buttonAdd.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
          }
      });
  }
  
  private void addArtist(){
      String name = editTextName.getText().toString().trim();
      String genre = spinnerCategory.getSelectedItem().toString();
  
      if(!TextUtils.isEmpty(name)){
  
          String id = databaseFood.push().getKey();
  
          Food food = new Food(id, name, genre);
  
  
          databaseFood.child(id).setValue(food);
  
          Toast.makeText(this, &quot;Food added to Fridge.&quot;, Toast.LENGTH_LONG).show();
      }
      else{
          Toast.makeText(this, &quot;You should enter a name&quot;, Toast.LENGTH_LONG).show();
      }
    }
  }
  </code></pre>
  <p>I also added a java class called Food</p>
  <pre><code>public class Food {
  
  String foodId;
  String foodName;
  String foodCategory;
  
  public  Food(){
  
  }
  
  public Food(String foodId, String foodName, String foodCategory) {
      this.foodId = foodId;
      this.foodName = foodName;
      this.foodCategory = foodCategory;
  }
  
  public String getFoodId() {
      return foodId;
  }
  
  public String getFoodName() {
      return foodName;
  }
  
  public String getFoodCategory() {
      return foodCategory;
  }
  
  }
  </code></pre>