I'm building an app using Firebase Realtime Database and I'm testing out the onFailure callback. I turn off my mobile data and run the code below.
mDatabaseReference.updateChildren(childUpdates)
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(TeamActivity.this, R.string.toast_message_error_add, Toast.LENGTH_LONG).show();
}
});
The issue is that the toast message doesn't pop up, then when I turn back on the mobile data, all of a sudden, my firebase database get populated a few seconds after. Now I understand this should happen when you set FirebaseDatabase.getInstance().setPersistenceEnabled(true), but I don't have this set and don't want it set. The app should show the toast message when the internet connection is off, because it should fail to write. Anyone know why this is happening?