title: Data not being saved to Firebase from Android App
body: <p>I have an existing application that I am trying to convert to use Firebase Database.   Here is some code that I am using when I try to save an Object:</p>
  
  <pre><code>...
  private FirebaseDatabase database;
  private DatabaseReference waypointRef;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      ...
  
      database = FirebaseDatabase.getInstance();
      waypointRef = database.getReference(Utils.WAYPOINT_REFERENCE);
  
      waypointRef.addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {
              FBWaypoint wp = dataSnapshot.getValue(FBWaypoint.class);
              wp.setId(dataSnapshot.getKey());
              Log.e(TAG, String.format("Child Added:  %s, %s, %s, Prev: %s", wp.getName(), wp.getLatitude(), wp.getLongitude(), previousChildName));
          }
  
          @Override
          public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) {
              FBWaypoint wp = dataSnapshot.getValue(FBWaypoint.class);
              Log.e(TAG, String.format("Child Changed:  %s, %s, %s, Prev: %s", wp.getName(), wp.getLatitude(), wp.getLongitude(), previousChildName));
          }
  
          @Override
          public void onChildRemoved(DataSnapshot dataSnapshot) {
              FBWaypoint wp = dataSnapshot.getValue(FBWaypoint.class);
              wp.setId(dataSnapshot.getKey());
              Log.e(TAG, String.format("Child Removed:  %s, %s, %s, Prev: %s", wp.getName(), wp.getLatitude(), wp.getLongitude()));
          }
  
          @Override
          public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) {
              FBWaypoint wp = dataSnapshot.getValue(FBWaypoint.class);
              Log.e(TAG, String.format("Child Moved:  %s, %s, %s, Prev: %s", wp.getName(), wp.getLatitude(), wp.getLongitude(), previousChildName));
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
              Log.e(TAG, "Failed to add Child Listener.", databaseError.toException());
          }
      });
      ...
  }
  </code></pre>
  
  <p>After creating an object, I save it like this:</p>
  
  <pre><code>waypointRef.push().setValue(wp);
  </code></pre>
  
  <p>I do see the callbacks firing in my logs at this point (along with values for the ids generated by firebase:</p>
  
  <pre><code>Child Added:  Hrbrbe, 44.969846, -89.670527, Prev: null
  Child Added:  Hdbece, 44.956019, -89.666436, Prev: -KInIzqk6m96lwVWF6Pc
  Child Added:  Hebdbr R, 44.970372, -89.673188, Prev: -KInJ17sfsQ4v_fUrAW3
  </code></pre>
  
  <p>However, I don't see anything in the firebase console for these records.   Also when I restart the app, the onChildAdded callback does not get fired.</p>
  
  <p>I also created another app, that just contains the code above...and that works fine.   So I am not sure if something I am doing in my existing application is impacting firebase?   However, I am not sure what that could be as I also took all of my dependancies and put them in the simple project as well.</p>
  
  <p>Any ideas on what I can check next?</p>
  
  <p>UPDATE:   I added the onComplete Listener as recommended.  It never gets called.   If I add a FirebaseDatabase.purgeOutstandingWrites() after the setValue(), then the onComplete gets called with the following error:</p>
  
  <pre><code>DatabaseError: The write was canceled by the user.
  </code></pre>