Skip to content

Instantly share code, notes, and snippets.

@yongjun823
Created December 21, 2017 12:34
Show Gist options
  • Select an option

  • Save yongjun823/cb241930bc9fe50ffb6da6dff342da65 to your computer and use it in GitHub Desktop.

Select an option

Save yongjun823/cb241930bc9fe50ffb6da6dff342da65 to your computer and use it in GitHub Desktop.
DataSnapshot
Iterable<DataSnapshot> dataSnapshots = dataSnapshot.getChildren();
for (DataSnapshot tempSnapshot : dataSnapshots) {
String value = tempSnapshot.getValue().toString();
String key = tempSnapshot.getKey();
if (key.equals("num")) {
Log.e(TAG, value);
} else if (key.equals("value")) {
Log.e(TAG, value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment