title: for loop not looping through arraylist
body: <p>I can get the following arraylist to be displayed but I thought that my for loop should be done correctly but it is not decrementing......</p>
  <pre><code>  DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child(&quot;Popular Clinics&quot;); // getReference() is the root
      reference.addValueEventListener(new ValueEventListener() {
          @RequiresApi(api = Build.VERSION_CODES.N)
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
              list.clear();
              // displayList.clear();
              for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
  
  
  
                 int count = (int) snapshot.getChildrenCount()-1;
  
                  for (int i = count; i &gt;= 0; i--) {
  
                      list.add(String.valueOf(snapshot.child(String.valueOf(i)).getValue()));
  
                      //    displayList.add(snapshot.getValue());
  
  
                     }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/rxSHq.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/90Pmw.png" alt="enter image description here" /></p>
  <p><a href="https://i.stack.imgur.com/g0HGg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g0HGg.png" alt="enter image description here" /></a></p>