-
-
Save gonzalonm/e049baa6b40c38e336a039638a9d198f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read from the database | |
myRef.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
// This method is called once with the initial value and again | |
// whenever data at this location is updated. | |
String value = dataSnapshot.getValue(String.class); | |
Log.d(TAG, "Value is: " + value); | |
} | |
@Override | |
public void onCancelled(DatabaseError error) { | |
// Failed to read value | |
Log.w(TAG, "Failed to read value.", error.toException()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment