Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

for loop in firebase snapshot in java

FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference();
myRef.addValueEventListener(new ValueEventListener() {
 @Override
 public void onDataChange(DataSnapshot dataSnapshot) {
    for(DataSnapshot item_snapshot:dataSnapshot.getChildren()) {

      Log.d("item id ",item_snapshot.child("item_id").getValue().toString());
      Log.d("item desc",item_snapshot.child("item_desc").getValue().toString());
     }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to write no in java 
Java :: how to write to a txt file in java in the end 
Java :: GLG203 
Java :: barcode design in postgresql 
Java :: int a[ ]={4,8,3,2}; a[0] = 23; a[3]= a[1]; a[2]=12; for(int i=0; i<a.length; i++) System.out.println(a[i]); 
Java :: modelmapper abstract class 
Java :: reset android studio settings windows 
Java :: java static inner class 
Java :: Uri/Beecrowd problem no - 1146 solution in Java 
Java :: hint property of plain text in android studio 
Java :: call method of another class without creating instance in java android 
Java :: factorial function in java recursion 
Java :: set class return type by jenric in java 
Java :: Java instanceof in Interface 
Java :: ava program to add two numbers taking input from user 
Java :: adding entity to calenderfx 
Java :: detect jpanel size change listener 
Java :: android volley benefits 
Java :: minecraft bukkit coding player sharing variable 
Java :: public class HelloWorld { public static void main( String[] argv ) { int a=4%2*3-1/0; System.out.println(a); } } 
Java :: programically set data source properties in spring 
Java :: java Generate parentheses all combinations 
Java :: No Duplicate Key on HashMap 
Java :: Run the ls command in the terminal to see the uncompiled .java file 
Java :: how to sort a interable in java 
Java :: session-less control using java 
Java :: delete row entity jpa java 
Java :: How can i stub Instant object using powermock 
Java :: java manajro 
Java :: Spring Boot user registration and login REST API 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =